Page 1 of 1

Copy to Clipboard

Posted: Thu May 27, 2010 5:58 pm
by gnana
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

Copy to Clipboard

Posted: Fri May 28, 2010 1:41 am
by Ferdinand Rios
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.