#include #include #include #include #Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 240, 156, 192, 124)
$Button1 = GUICtrlCreateButton("Set", 16, 56, 121, 81)
$Input1 = GUICtrlCreateInput("1000", 16, 24, 121, 21)
$Button2 = GUICtrlCreateButton("OpenMsg", 152, 85, 75, 50)
$lable1 = GUICtrlCreateLabel("0", 152, 25, 50, 50)
$s1 = GUICtrlSetData
$s1 = GUICtrlSetData
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Button1()
case $Button2
Button2()
EndSwitch
WEnd
Func Button1()
GUICtrlSetData($lable1, GUICtrlRead($Input1))
GUICtrlSetData($s1, GUICtrlRead($Input1))
EndFunc
Func Button2()
Sleep ($s1)
MsgBox(0,"Hello!","Hi!")
EndFunc
คือกด Button1 SetData ไปแล้วให้มันไปเซต Sleep ตั้งเวลาหน่วยในการโชว์ Msg โดยกด Button2 ยังไงหรอครับ
ขอบคุณครับ
$Form1 = GUICreate("Form1", 240, 156, 192, 124)
$Button1 = GUICtrlCreateButton("Set", 16, 56, 121, 81)
$Input1 = GUICtrlCreateInput("1000", 16, 24, 121, 21)
$Button2 = GUICtrlCreateButton("OpenMsg", 152, 85, 75, 50)
$lable1 = GUICtrlCreateLabel("0", 152, 25, 50, 50)
$s1 = GUICtrlSetData
$s1 = GUICtrlSetData
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Button1()
case $Button2
Button2()
EndSwitch
WEnd
Func Button1()
GUICtrlSetData($lable1, GUICtrlRead($Input1))
GUICtrlSetData($s1, GUICtrlRead($Input1))
EndFunc
Func Button2()
Sleep ($s1)
MsgBox(0,"Hello!","Hi!")
EndFunc
คือกด Button1 SetData ไปแล้วให้มันไปเซต Sleep ตั้งเวลาหน่วยในการโชว์ Msg โดยกด Button2 ยังไงหรอครับ
ขอบคุณครับ
แก้ไขล่าสุดโดย nurnger03 เมื่อ 30/03/14, 04:07 pm, ทั้งหมด 3 ครั้ง