Copy to Clipboard

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
Locked
User avatar
gnana
Posts: 3
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Fri Apr 09, 2010 3:52 am

Copy to Clipboard

Post 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

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

Copy to Clipboard

Post 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.
F.G. Rios

Locked