再来个易读版的,免得又有人说数组变量太多,看晕了。
#include <GuiTreeView.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$hGui0 = GUICreate('', 220, 600)
GUISetBkColor(0xFFFFFF)
GUICtrlSetDefBkColor(0xC0C0C0)
$Button1 = GUICtrlCreateLabel('Tab - 1', 10, 10, 200, 40, $SS_CENTER + $SS_CENTERIMAGE + $WS_BORDER)
GUICtrlSetFont(-1, 12, 400, 0, '微软雅黑')
$Button2 = GUICtrlCreateLabel('Tab - 2', 10, 450, 200, 40, $SS_CENTER + $SS_CENTERIMAGE + $WS_BORDER)
GUICtrlSetFont(-1, 12, 400, 0, '微软雅黑')
$Button3 = GUICtrlCreateLabel('Tab - 3', 10, 489, 200, 40, $SS_CENTER + $SS_CENTERIMAGE + $WS_BORDER)
GUICtrlSetFont(-1, 12, 400, 0, '微软雅黑')
$Button4 = GUICtrlCreateLabel('Tab - 4', 10, 528, 200, 40, $SS_CENTER + $SS_CENTERIMAGE + $WS_BORDER)
GUICtrlSetFont(-1, 12, 400, 0, '微软雅黑')
$Button0 = GUICtrlCreateLabel('', 41, 49, 168, 1)
$hGui1 = GUICreate('', 168, 400, 40, 49, $WS_CHILD + $WS_BORDER, -1, $hGui0)
GUISetBkColor(0xC0C0C0)
GUICtrlSetDefBkColor(0xC0C0C0)
$iTreeview1 = GUICtrlCreateTreeView(5, 5, 158, 390)
GUICtrlSetImage(-1, 'shell32.dll', 14)
$iTvItem1 = GUICtrlCreateTreeViewItem('TreeView1', $iTreeview1)
GUICtrlSetImage(-1, 'shell32.dll', 15)
GUICtrlCreateTreeViewItem('TvItem1 - 1', $iTvItem1)
GUICtrlCreateTreeViewItem('TvItem1 - 2', $iTvItem1)
GUICtrlCreateTreeViewItem('TvItem1 - 3', $iTvItem1)
$hGui2 = GUICreate('', 168, 400, 40, 88, $WS_CHILD + $WS_BORDER, -1, $hGui0)
GUISetBkColor(0xC0C0C0)
GUICtrlSetDefBkColor(0xC0C0C0)
$iTreeview2 = GUICtrlCreateTreeView(5, 5, 158, 390)
GUICtrlSetImage(-1, 'shell32.dll', 16)
$iTvItem2 = GUICtrlCreateTreeViewItem('TreeView2', $iTreeview2)
GUICtrlSetImage(-1, 'shell32.dll', 17)
GUICtrlCreateTreeViewItem('TvItem2 - 1', $iTvItem2)
GUICtrlCreateTreeViewItem('TvItem2 - 2', $iTvItem2)
GUICtrlCreateTreeViewItem('TvItem2 - 3', $iTvItem2)
$hGui3 = GUICreate('', 168, 400, 40, 127, $WS_CHILD + $WS_BORDER, -1, $hGui0)
GUISetBkColor(0xC0C0C0)
GUICtrlSetDefBkColor(0xC0C0C0)
$iTreeview3 = GUICtrlCreateTreeView(5, 5, 158, 390)
GUICtrlSetImage(-1, 'shell32.dll', 18)
$iTvItem3 = GUICtrlCreateTreeViewItem('TreeView3', $iTreeview3)
GUICtrlSetImage(-1, 'shell32.dll', 19)
GUICtrlCreateTreeViewItem('TvItem3 - 1', $iTvItem3)
GUICtrlCreateTreeViewItem('TvItem3 - 2', $iTvItem3)
GUICtrlCreateTreeViewItem('TvItem3 - 3', $iTvItem3)
$hGui4 = GUICreate('', 168, 400, 40, 166, $WS_CHILD + $WS_BORDER, -1, $hGui0)
GUISetBkColor(0xC0C0C0)
GUICtrlSetDefBkColor(0xC0C0C0)
$iTreeview4 = GUICtrlCreateTreeView(5, 5, 158, 390)
GUICtrlSetImage(-1, 'shell32.dll', 20)
$iTvItem4 = GUICtrlCreateTreeViewItem('TreeView3', $iTreeview4)
GUICtrlSetImage(-1, 'shell32.dll', 21)
GUICtrlCreateTreeViewItem('TvItem3 - 1', $iTvItem4)
GUICtrlCreateTreeViewItem('TvItem3 - 2', $iTvItem4)
GUICtrlCreateTreeViewItem('TvItem3 - 3', $iTvItem4)
GUISetState(@SW_SHOW, $hGui0)
GUISetState(@SW_SHOW, $hGui1)
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case $Button1
ControlMove($hGui0, '', $Button0, 41, 49)
ControlMove($hGui0, '', $Button1, 10, 10)
ControlMove($hGui0, '', $Button2, 10, 450)
ControlMove($hGui0, '', $Button3, 10, 489)
ControlMove($hGui0, '', $Button4, 10, 528)
GUICtrlSetState($Button0, $GUI_SHOW)
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetState($Button4, $GUI_SHOW)
GUISetState(@SW_HIDE, $hGui2)
GUISetState(@SW_HIDE, $hGui3)
GUISetState(@SW_HIDE, $hGui4)
GUISetState(@SW_SHOW, $hGui1)
Case $Button2
ControlMove($hGui0, '', $Button0, 41, 88)
ControlMove($hGui0, '', $Button1, 10, 10)
ControlMove($hGui0, '', $Button2, 10, 49)
ControlMove($hGui0, '', $Button3, 10, 489)
ControlMove($hGui0, '', $Button4, 10, 528)
GUICtrlSetState($Button0, $GUI_SHOW)
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetState($Button4, $GUI_SHOW)
GUISetState(@SW_HIDE, $hGui1)
GUISetState(@SW_HIDE, $hGui3)
GUISetState(@SW_HIDE, $hGui4)
GUISetState(@SW_SHOW, $hGui2)
Case $Button3
ControlMove($hGui0, '', $Button0, 41, 127)
ControlMove($hGui0, '', $Button1, 10, 10)
ControlMove($hGui0, '', $Button2, 10, 49)
ControlMove($hGui0, '', $Button3, 10, 88)
ControlMove($hGui0, '', $Button4, 10, 528)
GUICtrlSetState($Button0, $GUI_SHOW)
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetState($Button4, $GUI_SHOW)
GUISetState(@SW_HIDE, $hGui1)
GUISetState(@SW_HIDE, $hGui2)
GUISetState(@SW_HIDE, $hGui4)
GUISetState(@SW_SHOW, $hGui3)
Case $Button4
ControlMove($hGui0, '', $Button0, 41, 166)
ControlMove($hGui0, '', $Button1, 10, 10)
ControlMove($hGui0, '', $Button2, 10, 49)
ControlMove($hGui0, '', $Button3, 10, 88)
ControlMove($hGui0, '', $Button4, 10, 127)
GUICtrlSetState($Button0, $GUI_SHOW)
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetState($Button4, $GUI_SHOW)
GUISetState(@SW_HIDE, $hGui1)
GUISetState(@SW_HIDE, $hGui2)
GUISetState(@SW_HIDE, $hGui3)
GUISetState(@SW_SHOW, $hGui4)
EndSwitch
WEnd
|