944,045 Members | Top Members by Rank

Ad:
Sep 12th, 2005
0

Text Box Newbie help

Expand Post »
How do I get my text boxes to automatically highlight the default text so users can start typing without having to delete or highlight it themselves?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Lunaticrr is offline Offline
27 posts
since May 2005
Sep 12th, 2005
0

Re: Text Box Newbie help

Hi
To select text in a textbox control, you just need to specify the start and length of the selection, in characters. Paste this code into the form.load event handler, or wherever you want it..

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. 'set selection start to char 0
  2. Text1.SelStart = 0
  3. 'set selection length to the length of whatever's in the text box
  4. Text1.SelLength = Len(Text1.Text)

Hope this helps
Alan
Reputation Points: 13
Solved Threads: 1
Light Poster
AlanC is offline Offline
31 posts
since Jul 2005
Sep 13th, 2005
0

Re: Text Box Newbie help

Thanks alot. That works nicely.
Reputation Points: 10
Solved Threads: 0
Light Poster
Lunaticrr is offline Offline
27 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Crystal REport 9.0
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to load an image to a form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC