คลิ๊กทำตัวอักษรไหล ขึ้นกับลง คลิ๊กอีกครั้งจะหยุดนะครับ สคริ๊ปนี้ต้องกดหยุดไหลจึงจะปิดโปรแกรมได้
- Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 321, 123, 192, 124)
$Label1 = GUICtrlCreateLabel("ตัวอักษรไหล", 24, 16, 65, 17)
$Button1 = GUICtrlCreateButton("ไหลขึ้น", 208, 16, 75, 25)
$Button2 = GUICtrlCreateButton("ไหลลง", 208, 64, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Button1,"หยุด")
GUICtrlSetData($label1," ไหลขึ้นขึ้น")
While 1
For $i = 1 To 123
GUICtrlSetPos($label1, 10, 123-$i)
Switch GUIGetMsg()
Case $Button1
GUICtrlSetPos($label1, 24, 16)
ExitLoop 2
EndSwitch
Sleep(10)
Next
WEnd
Case $Button2
GUICtrlSetData($Button2,"หยุด")
GUICtrlSetData($label1," ไหลลงครับ")
While 1
For $i = 1 To 123
GUICtrlSetPos($label1, 10, 0+$i)
Switch GUIGetMsg()
Case $Button2
GUICtrlSetPos($label1, 24, 16)
ExitLoop 2
EndSwitch
Sleep(10)
Next
WEnd
EndSwitch
WEnd