He buscado agregar un ImageList a un Treeview, pero no me funciona. Alguien sabe o ha tenido la experiencia de decirme porque no funciona este codigo?
Code: Select all
#Include "FiveWin.ch"
Function Main()
LOCAL oDlg, oTree, oImageList
DEFINE DIALOG oDlg TITLE "TreeView from source"
oImageList = TImageList():New()
oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\folder.bmp", oDlg ),;
TBitmap():Define( , "..\bitmaps\16x16\fldMask.bmp", oDlg ) )
oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\form.bmp", oDlg ),;
TBitmap():Define( , "..\bitmaps\16x16\frmMask.bmp", oDlg ) )
oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\icon.bmp", oDlg ),;
TBitmap():Define( , "..\bitmaps\16x16\icoMask.bmp", oDlg ) )
oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\bitmap.bmp", oDlg ),;
TBitmap():Define( , "..\bitmaps\16x16\bmpMask.bmp", oDlg ) )
@ 0.5, 1 TREEVIEW oTree OF oDlg SIZE 80,60 COLOR 0, GetSysColor( 5 )
oTree:SetImageList( oImageList )
ACTIVATE DIALOG oDlg CENTERED ON INIT AddItems( oTree )
Return NIL
********************************************************************************
Function AddItems( oTree )
********************************************************************************
local oItem1, oItem2, oItem3
oItem1 = oTree:Add( "First", 0 )
oItem1:Add( "One", 1 )
oItem1:Add( "Two", 1 )
oItem1:Add( "Three", 1 )
oItem2 = oTree:Add( "Second", 0 )
oItem2:Add( "Hello" )
oItem2:Add( "World" )
oItem3 = oTree:Add( "Third", 0 )
oItem3:Add( "Last" )
oItem3:Add( "item" )
oTree:Expand()
Return NIL