#NoTrayIcon
#include <GuiListView.au3>
#include <GuiButton.au3>
#include <GuiStatusBar.au3>
#include <GuiTreeView.au3>
#include <StaticConstants.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
Local $aParts[3] = [150, 250, -1];定义状态栏
$Form1 = GUICreate("Form1", 429, 311,-1, -1)
$List1 = GUICtrlCreateListView("序号 | 内容 |", 8, 8, 409, 175,BitOR( $WS_VSCROLL, $WS_BORDER))
$Button1 = GUICtrlCreateButton("添加", 16, 200, 81, 33)
$Button2 = GUICtrlCreateButton("删除", 120, 200, 81, 33)
$Button3 = GUICtrlCreateButton("全选", 224, 200, 81, 33)
$Button4 = GUICtrlCreateButton("反选", 328, 200, 81, 33)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1, $aParts)
_GUICtrlStatusBar_SetText($StatusBar1, @TAB & "共有项目:" & @OSVersion, 0)
_GUICtrlStatusBar_SetText($StatusBar1, @TAB & "已选择:" & @OSVersion, 1)
_GUICtrlStatusBar_SetText($StatusBar1, @TAB & "文件:" & @OSVersion, 2)
GUIRegisterMsg($WM_SIZE, "WM_SIZE");调整状态栏位置
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Addlist()
Case $Button2
_GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($List1))
Case $Button3
Case $Button4
Exit
EndSwitch
WEnd
Func _Addlist()
GUISetState(@SW_DISABLE, $Form1)
$Form2 = GUICreate("请输入需要添加的数据", 250, 150, -1, -1, BitOR ($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))
$Button11 = GUICtrlCreateButton("保存", 60, 100, 50, 30, $WS_GROUP)
$Button12 = GUICtrlCreateButton("退出", 130, 100, 50, 30, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("数据A:", 20, 23, 55, 17)
$Label2 = GUICtrlCreateLabel("数据B:", 20, 53, 55, 17)
$Input1 = GUICtrlCreateInput("", 80, 20, 100, 21)
$Input2 = GUICtrlCreateInput("", 80, 50, 100, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3, $Button12
GUISetState(@SW_ENABLE, $Form1) ;启用父窗口
GUIDelete($Form2) ;;删除指定窗口和它包含的所有控件.
ExitLoop;Exit
Case $Button11
$num1=GUICtrlRead($Input1)
$num2=GUICtrlRead($Input2)
$Number = _GUICtrlListView_GetItemCount($List1)
_GUICtrlListView_AddItem($List1, $num1, $Number)
_GUICtrlListView_AddSubItem($List1, $Number, $num2, 1)
EndSwitch
WEnd
EndFunc ;==>_Addlist
;调整状态栏位置
Func WM_SIZE($hWnd, $msg, $wParam, $lParam)
_GUICtrlStatusBar_Resize($StatusBar1)
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE