#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("分离窗口测试", 338, 221, 263, 232)
$TreeView1 = GUICtrlCreateTreeView(8, 8, 105, 169)
$TreeView1_0 = GUICtrlCreateTreeViewItem("项目", $TreeView1)
$TreeView1_1 = GUICtrlCreateTreeViewItem("项目01", $TreeView1_0)
$TreeView1_2 = GUICtrlCreateTreeViewItem("项目02", $TreeView1_0)
$TreeView1_3 = GUICtrlCreateTreeViewItem("项目03", $TreeView1_0)
$TreeView1_4 = GUICtrlCreateTreeViewItem("功能", $TreeView1)
$TreeView1_5 = GUICtrlCreateTreeViewItem("功能01", $TreeView1_4)
$TreeView1_6 = GUICtrlCreateTreeViewItem("功能02", $TreeView1_4)
$TreeView1_7 = GUICtrlCreateTreeViewItem("功能03", $TreeView1_4)
$TreeView1_8 = GUICtrlCreateTreeViewItem("功能04", $TreeView1_4)
$TreeView1_9 = GUICtrlCreateTreeViewItem("列表", $TreeView1)
$TreeView1_10 = GUICtrlCreateTreeViewItem("列表01", $TreeView1_9)
$TreeView1_11 = GUICtrlCreateTreeViewItem("列表02", $TreeView1_9)
$TreeView1_12 = GUICtrlCreateTreeViewItem("列表03", $TreeView1_9)
$TreeView1_13 = GUICtrlCreateTreeViewItem("列表04", $TreeView1_9)
GUISetState(@SW_SHOW)
$Label001 = GUICtrlCreateLabel("项目 默认显示", 224, 100, 100, 17)
$Group1 = GUICtrlCreateGroup("演示001", 120, 0, 209, 177)
GUICtrlSetState(-1, $GUI_HIDE)
$Radio1 = GUICtrlCreateRadio("演示002", 128, 16, 113, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Checkbox1 = GUICtrlCreateCheckbox("演示003", 128, 32, 97, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Group2 = GUICtrlCreateGroup("演示004", 208, 48, 97, 73)
GUICtrlSetState(-1, $GUI_HIDE)
$Label1 = GUICtrlCreateLabel("演示005", 224, 88, 75, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Label002 = GUICtrlCreateLabel("功能 默认显示", 224, 100, 100, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Button1 = GUICtrlCreateButton("按钮1", 144, 136, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("按钮2", 232, 136, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
#EndRegion
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $TreeView1
hide()
GUICtrlSetState($Label001, $GUI_SHOW)
Case $TreeView1_1
hide()
GUICtrlSetState($Group1, $GUI_SHOW)
Case $TreeView1_2
hide()
GUICtrlSetState($Radio1, $GUI_SHOW)
Case $TreeView1_3
hide()
GUICtrlSetState($Checkbox1, $GUI_SHOW)
Case $TreeView1_4
hide()
GUICtrlSetState($Label002, $GUI_SHOW)
Case $TreeView1_5
hide()
_ceshi01()
Case $TreeView1_6
hide() ;隐藏
GUICtrlSetState($Label1, $GUI_SHOW) ;显示
Case $TreeView1_7
Case $Label1
Case $Button2
Case $TreeView1
EndSwitch
WEnd
Func _ceshi01()
$Label003 = GUICtrlCreateLabel("函数显示测试", 224, 100, 100, 17)
$Button003 = GUICtrlCreateButton("函数按钮", 144, 136, 75, 25)
EndFunc
Func hide()
GUICtrlSetState($Group1,$GUI_HIDE)
GUICtrlSetState($Label001,$GUI_HIDE)
GUICtrlSetState($Radio1,$GUI_HIDE)
GUICtrlSetState($Checkbox1,$GUI_HIDE)
GUICtrlSetState($Label002,$GUI_HIDE)
GUICtrlSetState($Label1,$GUI_HIDE)
EndFunc