Copy and Paste in Visual C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a copy button and a paste button. What code should I add to the copy
button and the paste button to do it's work?

Thanks,

Matt
 
Matt said:
I have a copy button and a paste button.
What code should I add to the copy
button and the paste button to do it's
work?

You don't explain what you want to copy and paste, but I expect you
should be using the Clipboard methods GetDataObject and SetDataObject.

P.
 
If you're just copying text to and from a textbox, then the textbox methods
"Copy" and "Paste" are a shortcut to the clipboard.
e.g.,
void Copy()
{
this.MyTextbox.Copy();
}
void Paste()
{
this.MyTextbox.Paste();
}
 
Back
Top