[英]C# clipboard direct copy paste
Hi 你好
I want to make direct copy/paste so for example I just make one click to button direct will make the paste to clipboard for this you can write example code 我想直接复制/粘贴,例如我只需点击一下按钮直接将粘贴到剪贴板为此你可以编写示例代码
If you want to copy from a textbox (in this example textBox1), this is what you need: 如果要从文本框中复制(在此示例中为textBox1),这就是您所需要的:
Clipboard.SetText(textBox1.Text); //To copy your text to your clipboard
Clipboard.GetText(); //To get your text from your clipboard
Use 采用
Clipboard.SetText("your Text")
Clipboard.SetText(“你的文字”)
to Put Text to Clipboard 将文本放入剪贴板
and 和
String myText = Clipboard.GetText()
String myText = Clipboard.GetText()
to recieve Text from Your Keyboard. 从键盘接收文本。
对于列表框:
myListbox.Items.Add(Clipboard.GetText());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.