PDA

Click to See Complete Forum and Search --> : Cut, Copy and Paste in VB programming


Idiot2VB
Nov 4th, 1999, 03:09 AM
Does anyone happen to know how a program can be written, so in an event procedure, text could be cut, copied or pasted? I really need the copy and paste ones. So, if u can get me all 3 of them i'd really appreciate that. thanks!

QWERTY
Nov 4th, 1999, 03:12 AM
Do you need to do it for text only or for Pictures too?

------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.

Aaron Young
Nov 4th, 1999, 03:13 AM
Not sure I get exactyl what you want, but, you can send the Cut/Copy Paste commands from code using the SendKeys Method, eg.

SendKeys "^X", 1 'Cut
SendKeys "^C", 1 'Copy
SendKeys "^V", 1 'Paste


Plus you can add and remove things from the the Clipboard using the Clipboard Object, eg.

Clipboard.SetText "Some Text"


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

Backbraker
Jan 24th, 2001, 09:21 AM
The Clipboard has the following events :

Clipboard.Gettext => Reads Text from Clipboard

Clipboard.Settext "text" => Puts text on Clipboard
Clipboard.Settext var => Copy variable to clipboard
Clipboard.Settext Text1.text => Copy content of Textbox to clipboard

Clipboard.Clear => Empties the clipboard

Just paste this code under a button or something and Voilą...