Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Images to the ImagesList control at Run-time
Message
From
19/09/1998 13:35:31
 
 
To
19/09/1998 07:21:46
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00138618
Message ID:
00138665
Views:
11
>I am trying to give the end-user to add items (w/images) to a treeview control at run-time. Is there a method associated with the ImagesList control which can be called from VFP to add a image (and it's associated key name). It would be nice if there were some sort of documentation on this and other OLE controls in general.
>Any help would be greatly appreciated.
>
>Thanks,
>GB

This is actually one of the BETTER documented controls, but you do have to hunt around through the help, very poorly organized.

To add images at run time:

Set the ImageList controls .ImageHeight and .ImageWidth properties first.
ImageListControl.ListImages.ImageHeight = 16
ImageListControl.ListImages.ImageWidth = 16

Now add images:

ImageListControl.ListImages.Add([index#],[key text],LoadPicture('path to icon'))

They recommend skipping the index parameter if you're adding/removing images at run-time.

ImageListControl.ListImages.Add(,"My Key",LoadPicture("icons\myicon.ico"))

HTH
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform