[Gambas-user] Copy data like Ctrl-C

ML d4t4full at ...626...
Wed Mar 9 17:01:25 CET 2016


On 2016-03-09 12:42, Rolf-Werner Eilert wrote:
> When I want to copy data for copy-and-paste like with Ctrl-C, how could 
> I do it directly from code (via press of a button) instead of offering a 
> text area for the mouse?
>
> In our database, sometimes I need a student's address in Writer or 
> another program. It would be nice to have a button to copy the relevant 
> fields automagically to be used in Writer by Ctrl-V.
>
> I haven't found any information about this because I don't know where to 
> look for.
>
> Thanks for your insight!
>
> Rolf
For that you should use the Clipboard object:

  Clipboard.Clear
  Clipboard.Copy(txtData.Text)

You can also .Paste() from the clipboard.




More information about the User mailing list