[WTA] copy text bt pressing Button

neopanda

New member
Joined
Nov 8, 2008
Messages
1
Programming Experience
Beginner
hi all,

i have a problem in "selecting all text in textbox an copy it" by pressing a button that i've created. could anyone help me how to do it?

i try to selected the text with this syntax :

VB.NET:
txtTicket.Select(0, 6)
txtTicket.SelectionStart = 0
txtTicket.SelectionLength = txtTicket.Text.Length
txtTicket.SelectAll()
txtTicket.Text.Copy(6)

i got no respond in my form.
 
If you want to select all the text then those first three lines are redundant. Just call SelectAll. If, by "copy", you mean copy the text to the Windows Clipboard then you need to call the Copy method of the TextBox, not of the String contained in the TextBox's Text property.
 
Back
Top