使用自定义函数
Func 函数名()
代码
EndFunc
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 300, 300, 192, 124)
$Button1 = GUICtrlCreateButton("tiaozhuan2", 80, 64, 121, 33, 0)
$Button2 = GUICtrlCreateButton("tiaozhuan3", 80, 124, 121, 33, 0)
GUISetState(@SW_SHOW)
HotKeySet("+!d", "tiaozhuan1") ;Shift-Alt-d快捷键,进入tiaozhuan1函数
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
tiaozhuan2();按下tiaozhuang2按钮时,执行tiaozhuan2()
Case $Button2
tiaozhuan3()
EndSwitch
WEnd
Func tiaozhuan1()
MsgBox(0, "", "11111111111")
EndFunc ;==>tiaozhuan1
Func tiaozhuan2()
MsgBox(0, "", "222222222222")
EndFunc ;==>tiaozhuan2
Func tiaozhuan3()
MsgBox(0, "", "33333333333333")
EndFunc ;==>tiaozhuan3
|