VB6 code to VB.net .Selstart and .SelLength

bradl45

Newcomer
Joined
Nov 2, 2002
Messages
3
Here is some code I use to high light a textbox when a user needs to re-enter data into a textbox, it works great in vb6 but not in .Net. Does anyone know what methods I would use in .Net to preform the same action.

txtname.Setfocus
txtname.Selstart = 0
txtname = Len(txtName.Text)



Thanks

Brad
SLC, Utah
 
Try this:

Visual Basic:
txtName.Focus()
txtName.Select(0, txtName.Text.Length)
 
I just realized you can shorten that last line down to txtName.SelectAll,
but the other way will work too.
 
Back
Top