#include <GuiTreeView.au3>
GUICreate('TreeView测试', 186, 157, 585, 462)
$hTreeView = GUICtrlCreateTreeView(16, 8, 153, 97)
$hItem_A = GUICtrlCreateTreeViewItem('A组', $hTreeView)
GUICtrlCreateTreeViewItem('111', $hItem_A)
GUICtrlCreateTreeViewItem('222', $hItem_A)
$hItem_B = GUICtrlCreateTreeViewItem('B组', $hTreeView)
GUICtrlCreateTreeViewItem('333', $hItem_B)
$Button1 = GUICtrlCreateButton('加载项目', 16, 120, 75, 25)
$Button2 = GUICtrlCreateButton('删除项目', 96, 120, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
_GUICtrlTreeView_Expand($hTreeView)
Case $Button2
_GUICtrlTreeView_Delete($hTreeView, $hItem_A)
_GUICtrlTreeView_Delete($hTreeView, $hItem_B)
GUICtrlSetState($Button1, 128)
EndSwitch
WEnd
|