Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make ImageList Control works
Message
From
25/02/1999 21:45:24
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00190787
Message ID:
00191751
Views:
18
The problem is to attach icons embeded in EXEs/DLLs, not from files.

Vlad

>I've used ImageList with TreeViews and ListView with both VFP5 & VFP6 and have had no problems.
>
>Bellow are a few good concepts on applying an ImageList with TreeViews and ListViews:
>
>
>*-- Images can be programatically loaded onto an ImageList as follow:
>
>WITH THISFORM.ImageList
>.ListImages.Add(,"folder_opened",LoadPicture("c:\test\opened.bmp"))
>.ListImages.Add(,"folder_closed",LoadPicture("c:\test\closed.bmp"))
>ENDWITH
>
>*-- You then associate your TreeView and ListView controls with the ImageList
>THISFORM.TreeView.ImageList = THISFORM.ImageList
>*-- SmallIcons (for Report View)
>THISFORM.ListView.SmallIcons = THISFORM.ImageList
>*-- Icons (for Icon View)
>THISFORM.ListView.Icons = THISFORM.AnotherImageList
>
>*-- Once you add nodes to your TreeView, you tell it what key value to use from *-- the related ImageList, in this sample the "folder_closed" in the icon
>*-- displayed when the tree node in not expanded and "folder_opened" when
>*-- expanded.
>oNode = THIS.Nodes.Add(,1,"Root","Root Node Text", "folder_closed", folder_opened" )
>
>*-- Once you add ListItmes to your ListView, you tell it what key value to
>*-- use from its related ImageList
>o = THISFORM.ListView.ListItems.Add(,,"ImageItem Text","image","selectedimage")
>o.ExpandedImage = "folder_opened"
Previous
Reply
Map
View

Click here to load this message in the networking platform