![](/img/trans.png)
[英]How do I copy formatted HTML string into a Clipboard for paste using C#?
[英]How do I do copy and paste in c#?
我想做一个鼠标右键单击菜单,它将具有“复制”和“粘贴”选项。
假设我有:
int p=int.Parse(Microsoft.VisualBasic.Interaction.InputBox(""));
p*=100;
Box b=new Box();//This is a form called "Box" that has a textbox in it. The result will be in the textbox.
b.Show();
所以现在,我想让用户通过右键菜单复制/粘贴到框中。 我该怎么做呢? 我正在使用WinForms。
此行为称为ContextMenu
,它将显示在RightMouseClick
。 由于您的问题不清楚,如果您使用的是Windows Forms
Application,它可以在TextBox
上使用。
Windows Form
上的默认ContextMenu
如果要在Windows窗体上的某些位置创建它,则可以使用ContextMenuStrip
控件。
看到这个: ContextMenuStrip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.