I am currently creating a small application that processes a line of text into several ouput lines using a C# Windows Form
What I am looking for is a way to duplicate the actions of manually copying text through Ctrl+C, or right click, Copy, by the click of a button.
In other words, how do I write to the clipboard/area that ctrl+c's text is stored?
Thanks,
Peter

Recommended Answers

All 4 Replies

CTRL+C stores the selected item to the Clipboard, which has a class.

Clipboard.SetText("Text You Want in Clipboard");

CTRL+C stores the selected item to the Clipboard, which has a class.

Clipboard.SetText("Text You Want Copied");

To Store To ClipBoard read jmurph333's solution to retrieve clipboard text us Clipboard.GetText();

Thanks, that was exactly what I was looking for

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.