Copy & Paste question

rnm89

Newcomer
Joined
Apr 1, 2003
Messages
20
I was wondering, is it possible to highlight & copy text to the clipboard from within textbox1.text using my button2 all in one step.

I am using the " Clipboard.SetDataObject(TextBox1.SelectedText)" command within my button2 properties, but I still have to highlight the text.
 
Visual Basic:
'To highlight text:
TextBox1.SelectionStart = 0
TextBox1.SelectionLength = Len(TextBox1.Text)

'To just copy the whole text:
Clipboard.SetDataObject(TextBox1.Text)
 
Back
Top