#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 435, 447, 191, 124)
$Label1 = GUICtrlCreateLabel("任务列表", 8, 8, 52, 17)
$list = GUICtrlCreateList("", 8, 24, 417, 153)
$RightMenu = GUICtrlCreateContextMenu($list)
$RightDel = GUICtrlCreateMenuItem("删除", $RightMenu)
$Tab1 = GUICtrlCreateTab(8, 184, 417, 169)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("运行程序")
$Label2 = GUICtrlCreateLabel("运行程序", 16, 216, 52, 17)
$Combo1 = GUICtrlCreateCombo("Combo1", 72, 216, 145, 25)
$Button1 = GUICtrlCreateButton("浏览", 224, 216, 75, 25)
$Label3 = GUICtrlCreateLabel("运行参数", 16, 240, 52, 17)
$Input1 = GUICtrlCreateInput("Input1", 72, 240, 145, 21)
$Button2 = GUICtrlCreateButton("删除下试试", 16, 288, 75, 25)
$Button3 = GUICtrlCreateButton("记录信息", 100, 288, 75, 25)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$chengxu = GUICtrlRead($Combo1)
$canshu = GUICtrlRead($Input1)
For $o = 1 To 10
GUICtrlSetData($list, '"' & $chengxu + $o & ' ' & $canshu + $o & '"')
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If $chengxu <> '' Then
GUICtrlSetData($list, '"' & $chengxu & ' ' & $canshu & '"')
Else
MsgBox(64, '提示', '你没有选择要运行的程序')
EndIf
Case $Button2
del()
Case $Button3
Rdlist()
EndSwitch
WEnd
Func del()
$i = _GUICtrlListBox_GetCurSel($list)
If $i = -1 Then
MsgBox(0, '', '未选择')
Return
EndIf
_GUICtrlListBox_DeleteString($list, $i)
EndFunc ;==>Del
Func Rdlist()
Local $a
$RD = _GUICtrlListBox_GetCount($list)
For $i = 0 To $RD - 1
$a &= _GUICtrlListBox_GetText($list, $i) & @LF
Next
MsgBox(0, '', $a)
EndFunc