[英]How can I add my own item to the default context menu of a textbox (cut, copy, paste, <my item>).
I'm surprised how hard it is to find a solution to this question. 我很惊讶找到这个问题的解决方案有多么困难。 I can't seem to find anyone else asking it.
我似乎找不到其他人问。
I have some basic textbox controls on my form. 我的表单上有一些基本的文本框控件。 In addition to the standard cut/copy/paste options when you right click in the box, I want to add my own additional item.
右键单击框时,除了标准的剪切/复制/粘贴选项外,我还想添加自己的其他项目。
Any idea how I can achieve this? 知道我该如何实现吗? I don't even know where to start.
我什至不知道从哪里开始。
Thanks 谢谢
It's been suggested to implement your own menu; 建议您实现自己的菜单。 you can provide the default actions and add your own as well.
您可以提供默认操作 ,也可以添加自己的操作 。
I suggest checking out the control called ContextMenuControl. 我建议签出名为ContextMenuControl的控件。 This control allows you to create a menu and assign it to the controls that you would like to have this menu pop up with.
该控件允许您创建一个菜单,并将其分配给您希望弹出该菜单的控件。 then when a user right-clicks on the textbox, your menu will pop up.
然后,当用户右键单击文本框时,将弹出菜单。
Have a look at this: http://msdn.microsoft.com/en-us/library/aa984254(v=vs.71).aspx 看看这个: http : //msdn.microsoft.com/en-us/library/aa984254(v=vs.71).aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.