Information générale
Catégorie:
Contrôles ActiveX en VFP
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"
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement