How to copy textbox1.text to clipboard

theyikes

New member
Joined
Mar 27, 2024
Messages
1
Programming Experience
Beginner
Hi! ok i'll make this as simple as possible. I've written a piece of code that trims a text string . The result is outputted to a textbox. my questions is how do i copy the textbox1.text to clipboard?I know this is a newb question but then again I am a newbie. Any help would be gratefully appreciated
 
This is a perfect example of why you ALWAYS need to read the relevant documentation first when you have an issue/question. You'll solve many of your own problems faster by doing so and you'll learn more besides. If you had read the documentation for the TextBox class in this case, you'd have seen that it has a Copy method to do exactly what you want. We're still here for the stuff you can't solve on your own but you'll save time and learn more if you read the relevant documentation every time. In VS, you can use the F1 key to go directly to specific pages for types or members or you can use the Help menu to go to the documentation home page. That said, I'd recommend bookmarking/favouriting the API reference home page in your browser, as you still need several clicks to get there when using the Help menu. This is the Australian version that I use. You can just change the culture to get the appropriate version for you.
 
In case you want to copy all text, and not just selection, check out the Clipboard class.
 
Back
Top