本帖最后由 heroxianf 于 2017-6-14 11:48 编辑
我想获取$item1空间的 选中状态,请问用什么函数呢?
#include <GuiButton.au3>
GUICreate("AU3",300,200)
$Label1 = GUICtrlCreateLabel("右键菜单", 18, 160, 70, 15)
GUICtrlSetColor($Label1,0xff0000)
$context = GUICtrlCreateContextMenu($Label1)
$item1 = GUICtrlCreateMenuItem('菜单1', $context)
$item2 = GUICtrlCreateMenuItem('菜单2', $context)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $item1
GUICtrlSetState($item1, 1)
Case $item2
Local $tt = _GUICtrlButton_GetState($item1)
MsgBox(0, "", $tt)
EndSwitch
WEnd
|