本帖最后由 曼菲士 于 2011-6-29 09:45 编辑 $Form1 = GUICreate("测试窗口", 372, 139, -1, -1)
$Label1 = GUICtrlCreateLabel("0", 8, 56, 150, 17)
GUISetState(@SW_SHOW)
local $TableListView = GUICtrlCreateListView("test", 280, 0, 90, 130)
;右键菜单
$RightMenu = GUICtrlCreateContextMenu($TableListView)
$m1 = GUICtrlCreateMenuItem("菜单1", $RightMenu)
GUICtrlCreateMenuItem("", $RightMenu)
$m2 = GUICtrlCreateMenuItem("菜单2", $RightMenu)
GUICtrlCreateMenuItem("", $RightMenu)
$m3 = GUICtrlCreateMenuItem("菜单3", $RightMenu)
Local $iii = 0
While 1
If GUIGetMsg() = -3 Then Exit
$iii += 1
GUICtrlSetData($Label1, $iii)
Sleep(50)
WEnd
以上代码直接运行即可,当点右键菜单时,计数会停止,除了用多线程外还有没有其它解决办法? |