GUICtrlSetOnEvent ...#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $Form1, $SB, $DownARB, $EB
$Form1 = GUICreate("Test", 605, 351)
GUISetOnEvent($GUI_EVENT_CLOSE, "Event")
$SB = GUICtrlCreateButton("扫描", 240, 312, 105, 25)
GUICtrlSetOnEvent($SB, "Event")
$DownARB = GUICtrlCreateButton("下载", 360, 312, 121, 25)
GUICtrlSetOnEvent($DownARB, "Event")
$EB = GUICtrlCreateButton("退 出", 496, 312, 97, 25)
GUICtrlSetOnEvent($EB, "Event")
GUISetState(@SW_SHOW)
While 1
Sleep(10)
WEnd
Func Event()
Switch @GUI_CtrlId
Case $EB
Exit
Case $GUI_EVENT_CLOSE
Exit
Case $SB
SysSearch()
Case $DownARB
nDownload()
EndSwitch
EndFunc ;==>Event
Func nDownload()
MsgBox(0, 0, '下载')
EndFunc ;==>nDownload
Func SysSearch()
MsgBox(0, 0, '扫描')
EndFunc ;==>SysSearch
|