Copy to Clipboard

Support for all customers who have purchased or received a Productivity Pack Support product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
gnana
Posts: 3
Joined: Fri Apr 09, 2010 3:52 am

Copy to Clipboard

Post by gnana » Thu May 27, 2010 5:58 pm

Hi, I am developing a tool using Primal form 2009. How to copy the content of a text box to clipboard.I have $textbox1 and $button1. When I click on $button1, it should copy the content of $textbox1 and I should be able to past it in other applications. Is there a way to doing this ??ThanksGnana

User avatar
Ferdinand Rios
Posts: 372
Joined: Tue Nov 14, 2006 2:56 am

Copy to Clipboard

Post by Ferdinand Rios » Fri May 28, 2010 1:41 am

In the code for your button click, add the following:

[System.Windows.Forms.Clipboard]::SetText($textbox1.text)

That copies the contents of the textbox to the clipboard. If you package this form make sure you select the STA option as clipboard functions need to be in STA mode.
F.G. Rios

Locked