为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键)

2018-01-13 2页 doc 13KB 10阅读

用户头像

is_597436

暂无简介

举报
2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键)2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键) #include $Gui = GUICreate("test") $Edit = GUICtrlCreateEdit("", 20, 20) $DummyMenu = GUICtrlCreateDummy() $ContextMenu = GUICtrlCreateContextMenu($DummyMenu) $MenuItem1 = GUICtrlCreateMenuItem("菜单1", $ContextM...
2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键)
2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键) #include $Gui = GUICreate("test") $Edit = GUICtrlCreateEdit("", 20, 20) $DummyMenu = GUICtrlCreateDummy() $ContextMenu = GUICtrlCreateContextMenu($DummyMenu) $MenuItem1 = GUICtrlCreateMenuItem("菜单1", $ContextMenu) $MenuItem2 = GUICtrlCreateMenuItem("菜单2", $ContextMenu) GUICtrlCreateMenuItem("", $ContextMenu) $ExitMenuItem = GUICtrlCreateMenuItem("退出", $ContextMenu) GUISetState() While 1 $CurInfo = GUIGetCursorInfo($Gui) $Msg = GUIGetMsg() Select Case $Msg = -3 Exit Case $CurInfo[3] = 1 And $CurInfo[4] = $Edit ShowMenu($Gui, $ContextMenu) Case $msg = $ExitMenuItem Exit EndSelect WEnd ; Show a menu in a given GUI window which belongs to a given GUI ctrl Func ShowMenu($hWnd, $nContextID) Local $hMenu = GUICtrlGetHandle($nContextID) $arPos = MouseGetPos() Local $x = $arPos[0] Local $y = $arPos[1] DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0) EndFunc Func _exit() Exit EndFunc ;左键菜单: ; Case $CurInfo[2] = 1 And $CurInfo[4] = $Edit ; ShowMenu($Gui, $ContextMenu)
/
本文档为【2016-2017年GUICtrlCreateEdit创建的Edit控件中怎样添加右键菜单(左键)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索