|
请教各位朋友,关于GUICtrlCreateMenu,有没有办法实现点退出就可以直接响应,就是不用点出下拉菜单。
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
Example()
Func Example()
GUICreate("菜单控件 GUI", 300, 200)
Local $idFilemenu = GUICtrlCreateMenu("文件")
Local $idFileitem = GUICtrlCreateMenuItem("打开", $idFilemenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
Local $idHelpmenu = GUICtrlCreateMenu("退出")
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $idFileitem
MsgBox(0,'','test1',1)
Case $idHelpmenu
MsgBox(0,'','test2',1)
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
GUIDelete()
EndFunc
|
|