Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi how to create copy and paste button in c#.net win forms
please help me give me the code.

Thanks & Regards
Sairam Bhat
Posted

1 solution

You should study
here
<or>

you can use like this
C#
private void btnCopy_Click(object sender, EventArgs e)
       {
           Clipboard.SetText(txtClipboard.Text);
       }
       private void btnPaste_Click(object sender, EventArgs e)
       {
           txtResult.Text = Clipboard.GetText();
       }



May be helpful,
Theingi Win
 
Share this answer
 
v2
Comments
sairam.bhat 5-Mar-11 2:21am    
Thnak you very much sir
Theingi Win 5-Mar-11 2:23am    
Welcome! sairam.bhat
:)
Dima Popov 5-Mar-11 2:48am    
This is a good answer, but there should be a try/catch block as sometimes Clipboard.SetText throws exceptions caused by native method calls.
Sergey Alexandrovich Kryukov 6-Mar-11 0:28am    
Dima, I never faced such thing. Could you make a code sample for this problem?
--SA
Sergey Alexandrovich Kryukov 6-Mar-11 0:29am    
Dima, and what's wrong with your Answer, why it is deleted?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900