>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