|
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=i:\学习资料\图形设计\3\form2.kxf
$Form1_1 = GUICreate("", 531, 442, 192, 124)
$Group1 = GUICtrlCreateGroup("信息输入", 24, 32, 481, 169)
$Input1 = GUICtrlCreateInput("", 176, 64, 73, 21)
$List1 = GUICtrlCreateList("", 350, 39, 121, 162)
$Button1 = GUICtrlCreateButton("添加", 80, 160, 65, 25)
$Button2 = GUICtrlCreateButton("重置", 184, 160, 65, 25)
$Input2 = GUICtrlCreateInput("", 80, 104, 169, 21)
$Label1 = GUICtrlCreateLabel("数量", 80, 64, 28, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("结果显示", 24, 224, 481, 145)
$Label2 = GUICtrlCreateLabel("", 26, 239, 477, 128, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 36, 800, 0, "宋体")
GUICtrlSetCursor (-1, 2)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("关于", 24, 384, 80, 33)
$Button4 = GUICtrlCreateButton("执行", 304, 384, 80, 33)
$Button5 = GUICtrlCreateButton("退出", 424, 384, 80, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_main()
Exit
Func _main()
While 1
Local $nMsg
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Input1
Local $n=GUICtrlRead($Input1)
Local $sz[$n]
Case $Input2
Local $p=GUICtrlRead($Input2)
Local $lr[$n]
For $n=1 To UBound($sz)-1
$lr[$n]=$p
$sz[$n]=$lr[$n]
Next
Case $Button1
GUICtrlSetData($List1,$p)
Case $Button2
GUICtrlSetData($Input1,"")
GUICtrlSetData($Input2,"")
GUICtrlSetData($List1,"")
Case $Button4
_zhixing($sz)
Case $Button5
Exit
EndSwitch
WEnd
EndFunc
Func _zhixing($sz)
Local $max=UBound($sz,1)-1
Local $x
For $x=0 To 30
Sleep(100)
Local $sj=Random(1,$max,1)
Local $xc=$sz[$sj]
Sleep(50)
GUICtrlSetData($Label2,$xc)
Next
EndFunc |
|