Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode=1
#Include "win32api.inc"
%IDC_TreeView = 500
Global hDlg,hItem,hTemp,hTreeView As Dword
Function PBMain() As Long
Local ttviex As TVItemEX
Dialog New Pixels, 0, "TreeView",200,200,155,150, %WS_SysMenu, 0 To hDlg
Control Add Treeview, hDlg, %IDC_TreeView, "", 10,10,130,125, %WS_TabStop Or %TVS_HasButtons _
Or %TVS_LinesAtRoot Or %TVS_HasLines Or %TVS_ShowSelAlways Or %TVS_CheckBoxes
Control Handle hDlg, %IDC_TreeView To hTreeView
Treeview Insert Item hDlg, %IDC_TreeView, 0, %TVI_Last, 1,1,"One" To hItem
ttviex.mask = %TVIF_STATE
ttviex.stateMask = %TVIS_STATEIMAGEMASK
ttviex.state = 0
ttviex.hItem = hItem
SendMessage hTreeView, %TVM_SetItem, 0, ByVal VarPtr(ttviex)
Treeview Insert Item hDlg, %IDC_TreeView, hItem, %TVI_Last, 1,4,"One-1" To hTemp
Treeview Insert Item hDlg, %IDC_TreeView, hItem, %TVI_Last, 2,4,"One-2" To hTemp
Treeview Insert Item hDlg, %IDC_TreeView, 0, %TVI_Last, 2,2,"Two" To hItem
ttviex.mask = %TVIF_STATE
ttviex.stateMask = %TVIS_STATEIMAGEMASK
ttviex.state = 0
ttviex.hItem = hItem
SendMessage hTreeView, %TVM_SetItem, 0, ByVal VarPtr(ttviex)
Treeview Insert Item hDlg, %IDC_TreeView, hItem, %TVI_Last, 1,4,"Two-1" To hTemp
Treeview Insert Item hDlg, %IDC_TreeView, hItem, %TVI_Last, 2,4,"Two-2" To hTemp
Dialog Show Modal hDlg
End Function
'gbs_01260
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm