Text Box Newbie help

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2005
Posts: 27
Reputation: Lunaticrr is an unknown quantity at this point 
Solved Threads: 0
Lunaticrr Lunaticrr is offline Offline
Light Poster

Text Box Newbie help

 
0
  #1
Sep 12th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 31
Reputation: AlanC is an unknown quantity at this point 
Solved Threads: 1
AlanC's Avatar
AlanC AlanC is offline Offline
Light Poster

Re: Text Box Newbie help

 
0
  #2
Sep 12th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 27
Reputation: Lunaticrr is an unknown quantity at this point 
Solved Threads: 0
Lunaticrr Lunaticrr is offline Offline
Light Poster

Re: Text Box Newbie help

 
0
  #3
Sep 13th, 2005
Thanks alot. That works nicely.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC