HOWTO: Programmatically Adding Images to ImageList ControlLast reviewed: June 17, 1997Article ID: Q166937 |
The information in this article applies to:
SUMMARYThis article describes how you can programmatically add images to the ImageList ActiveX control.
MORE INFORMATIONAn ImageList control contains a collection of ListImage objects, each of which can be referred to by its index or key. The ImageList ActiveX control acts as a central image repository to conveniently supply other controls with images. In order to add an image at run time, you need to use the Add Method of the ListImages collection.
SyntaxThe Add method syntax has these parts:
Object.Add([Index,| Key,] Picture)
ExampleThe steps below demonstrate how to create an example of one of these controls:
You are not limited to any particular image size; however, the total number of images that can be loaded into ImageList ActiveX control is limited by the amount of available memory. At design time, you can add images using the Image tab of the ImageList Control Properties dialog box. To access this, right-click (secondary) on the ImageList control and select ImageListCtrl Properties from the shortcut menu. Omit step 5 above to have images added in this manner show on the tabs when the Command button is clicked. The code in step 6 above could be placed in the Init method of the form to have the SSTab control show the images when the form is loaded.
REFERENCESCustom Control Reference (Ctrlref.hlp in the Windows\System or WinNT\System32 folder if using Visual FoxPro version 5.0) Windows Common Controls help file (Comctl1.hlp in the Windows\System or WinNT\System32 folder if using version 5.0a). To access the Help file, right-click on the ImageList control on the form and select Help from the shortcut menu. In the ImageList Control topic, click See Also to jump to the ListImage Object, ListImages Collection topic. Select the Add Method (ListImages Collection) from the Methods jump. |
Keywords : FxinteropOcx kbinterop vfoxwin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |