#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <SliderConstants.au3>
#include <GuiListView.au3>
Opt("wintitlematchmode",2)
Opt("mousecoordmode",2)
Global $x ;方式选择
Global $z ;根据$x的值确定自己
Global $y=465 ;垂直方向坐标
Global $wincreated
Global $p,$n
_Kuangjia();人机界面
Func _Kuangjia();人机界面
Local $treeview,$item1,$item2,$shuomin,$xiaoyue,$shenghe
Local $startlabel,$shuomin_label,$xiaoyue_ListView,$shenghe_ListView
Local $gotobutton,$cancelbutton
Local $msg,$item,$text
$font="楷体_GB2312"
$wincreated = GUICreate("",275,220)
$treeview = GUICtrlCreateTreeView(5, 27, 139, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$item1 = GUICtrlCreateTreeViewItem("Item_1", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$item2 = GUICtrlCreateTreeViewItem("Item_2", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$shuomin = GUICtrlCreateTreeViewItem("说明", $item1)
GUICtrlSetColor(-1, 0xff0000)
$xiaoyue = GUICtrlCreateTreeViewItem("萧跃", $item1)
$shenghe = GUICtrlCreateTreeViewItem("沈河", $item1)
$startlabel = GUICtrlCreateLabel("startlabel", 150, 35, 120, 95)
GUICtrlSetFont(-1,12,800,0,$font)
GUICtrlSetColor(-1,0xff0000)
$shuomin_label = GUICtrlCreateLabel("shuomin_label", 155, 45, 110, 95)
GUICtrlSetFont(-1,10,400)
GUICtrlSetColor(-1,0xff0000)
GUICtrlSetState(-1, $GUI_HIDE)
$xiaoyue_ListView = GUICtrlCreateListView("", 150, 27, 120, 110)
_GUICtrlListView_AddColumn($xiaoyue_ListView, "No", 30,2)
_GUICtrlListView_AddColumn($xiaoyue_ListView, "人员", 60)
GUICtrlCreateListViewItem("01|小华", $xiaoyue_ListView)
GUICtrlCreateListViewItem("02|小强", $xiaoyue_ListView)
GUICtrlCreateListViewItem("03|小贤", $xiaoyue_ListView)
GUICtrlCreateListViewItem("04|小乐", $xiaoyue_ListView)
GUICtrlCreateListViewItem("05|老龙", $xiaoyue_ListView)
GUICtrlCreateListViewItem("06|老军", $xiaoyue_ListView)
GUICtrlCreateListViewItem("07|大熊", $xiaoyue_ListView)
GUICtrlSetState($xiaoyue_ListView, $GUI_HIDE)
$shenghe_ListView = GUICtrlCreateLabel("沈河", 155, 55, 110, 50)
GUICtrlSetFont(-1,15,800,0,$font)
GUICtrlSetColor(-1,0xff0000)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlCreateLabel("",150, 28, 120, 2, $SS_SUNKEN)
GUICtrlCreateLabel("",150, 136, 120, 2, $SS_SUNKEN)
$gotobutton = GUICtrlCreateButton("确定",150, 143, 57, 20)
$cancelbutton = GUICtrlCreateButton("取消",213, 143, 57, 20)
; 默认展开并加粗
GUICtrlSetState($item1, BitOR($GUI_EXPAND, $GUI_DEFBUTTON))
GUICtrlSetState($item2, BitOR($GUI_EXPAND, $GUI_DEFBUTTON))
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $cancelbutton Or $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $item1
$x=0
GUIChangeItems($shuomin_label,$xiaoyue_ListView,$shenghe_ListView,$startlabel,$startlabel)
Case $msg = $item2
$x=0
GUIChangeItems($shuomin_label,$xiaoyue_ListView,$shenghe_ListView,$startlabel,$startlabel)
Case $msg = $shuomin
$x=0
GUIChangeItems($startlabel,$xiaoyue_ListView,$shenghe_ListView,$shuomin_label,$shuomin_label)
Case $msg = $xiaoyue
$x=1
GUIChangeItems($startlabel,$shuomin_label,$shenghe_ListView,$xiaoyue_ListView,$xiaoyue_ListView)
Case $msg = $xiaoyue_ListView
$x=3
$p = GUICtrlRead(GUICtrlRead($xiaoyue_ListView))
Case $msg = $shenghe
$x=2
GUIChangeItems($startlabel,$shuomin_label,$xiaoyue_ListView,$shenghe_ListView,$shenghe_ListView)
Case $msg = $gotobutton
If $x = 0 Then
MsgBox(0, "", "错误")
Exit
Else
GUISetState(@SW_HIDE,$wincreated)
_star()
EndIf
EndSelect
WEnd
EndFunc
Func GUIChangeItems($hide1, $hide2, $hide3,$show1, $show2)
Local $idx
For $idx = $hide1 To $hide3
GUICtrlSetState($idx, $GUI_HIDE)
Next
For $idx = $show1 To $show2
GUICtrlSetState($idx, $GUI_SHOW)
Next
EndFunc
;选择动作方式
Func _star()
Select
Case $x=1
MsgBox(0,"","萧跃")
Case $x=2
MsgBox(0,"","沈河")
Case $x=3
MsgBox(0,"",$p)
EndSelect
Exit
EndFunc