vb.net 和 ContextMenuStrip?

发布于 2024-09-14 05:25:42 字数 109 浏览 0 评论 0原文

我正在使用 winforms 和 vb.net。 当我右键单击文本框时,我会看到复制/粘贴等弹出菜单。这没关系。但是,如何向此菜单添加某些内容,以及当单击我添加到其中的项目时,我将在哪里/如何拦截该事件?

I'm using winforms and vb.net.
When I right click on a textbox I get the copy/paste/etc popup menu. This is ok. But How can I add something to this menu, and where/how would I intercept the event when one would click on the Item I add to it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三人与歌 2024-09-21 05:25:42

此上下文菜单内置于 Windows 中,没有记录的方法可以更改它。也不存在任何可以诱骗您破解菜单的消息。更换它当然是一个选择,请检查我的答案 此线程获取示例代码。

请小心这一点,在不同的 Windows 版本中,内容会添加到此菜单中。就像Win7中的“插入Unicode字符”一样。如果您的产品可能在东亚国家/地区运行,您肯定希望避免这种情况。

This context menu is baked into Windows, there is no documented way to alter it. Nor is there a message that you could trap to hack the menu. Replacing it is certainly an option, check my answer in this thread for sample code.

Be careful with this, stuff gets added to this menu in different Windows versions. Like "Insert Unicode character" in Win7. You definitely want to avoid this if it is likely that your product will run in an Eastern Asian country.

嗳卜坏 2024-09-21 05:25:42

如果您不想使用默认菜单,则必须添加自己的菜单。

您必须用自己的代码替换现有的默认函数。

You'll have to add your own menu if you don't want to use the default.

You'll have to replace the existing default functions with your own code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文