Click here to Skip to main content
15,566,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making a calculator in C#.net visual studio 2010. but i want to copy the text of my textbox
and paste it to anywhere in window's wordpad,notepad etc. how this can possible in c#. Please guide me
Posted
Comments
Prasad_Kulkarni 15-May-13 2:56am    
AFAIK you can easily copy the text from your text box.

Check if you disabled the text box or used any copy prevention code for it.

1 solution

Copying to the clipboard is easy:
C#
Clipboard.SetText(myTextBox.Text);

Pasting into other applications is harder, if you want to do it directly from C# rather than letting the user do it. You can do it via SendKeys[^] but to be honest, that isn't a good practice: if your application started messing with my clipoard just to transfer info to Word or Excel, then I would unistall it with extreme prejudice.

What are you trying to achieve that you think this is a necessary and good idea?
 
Share this answer
 
Comments
Samresh.ss 15-May-13 3:07am    
I think the objective is to emulate the Window's Calculator 'Edit > Copy' option
sakshi111 15-May-13 3:10am    
yes sir like window xp calculator copy and paste please tell me how can i do it.
OriginalGriff 15-May-13 3:25am    
See above: it's only one line of code!

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