-
Nov 2nd, 2002, 05:53 PM
#1
Thread Starter
New Member
VB6 code to VB.net .Selstart and .SelLength
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
-
Nov 2nd, 2002, 08:23 PM
#2
Its pretty much the same
txtName.SetFocus
txtName.SelectionStart = 0
txtName.SelectionLength = Len(txtName.Text)
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Nov 2nd, 2002, 11:21 PM
#3
Thread Starter
New Member
Thanks, That's what I was looking for.
Brad
-
Nov 3rd, 2002, 12:51 AM
#4
Junior Member
Now there is .TextLength so you do not need to extract the text to a string just to get the length. The temporary string just has to be garbage collected later.
-
May 4th, 2012, 08:53 AM
#5
New Member
Re: VB6 code to VB.net .Selstart and .SelLength
What is the difference between GotFocus and setFocus?
-
May 4th, 2012, 09:02 AM
#6
Re: VB6 code to VB.net .Selstart and .SelLength
Originally Posted by VbNat
What is the difference between GotFocus and setFocus?
You realise this topic is 10 years old? You should start a new thread for any questions you have.
In any case: GotFocus is an event that you subscribe to.. SetFocus is a method you call.
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|