Click to See Complete Forum and Search --> : For Aaron Young or QWERTY:
Idiot2VB
Nov 4th, 1999, 03:35 AM
ok, the code you gave me for copy was..
SendKeys "^C", 1 'Copy
now how do i use this?
I have a textbox named Text1. And a command button named Command1. Now, if u can tell me how to code, so when i click the command button, it takes whats inside the textbox, and copies it. How do i do it? Thanks.
Aaron Young
Nov 4th, 1999, 03:43 AM
Method1:
Private Sub Command1_Click()
Clipboard.SetText Text1.SelText
End Sub
Method2:
Private Sub Command1_Click()
Text1.SetFocus
SendKeys "^C", 1
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
QWERTY
Nov 4th, 1999, 03:43 AM
Put this codes into Click Event of a appropriate CommandButton:
Private Sub cmdCopy_Click()
Clipboard.SetText Text1.SelText 'Copies only selected text
'change Text1.SelText to Text1.Text if you want to copy whole TextBox
End Sub
Private Sub cmdCut_Click()
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End Sub
------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 11-04-1999).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.