Copy to Clipboard
Copy to Clipboard
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
- Ferdinand Rios
- Posts: 373
- Last visit: Fri Sep 16, 2022 1:24 pm
Copy to Clipboard
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.
[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