Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 09-24-2002, 09:47 PM   #1
Member (6 bit)
 
BustaCap's Avatar
 
Join Date: Aug 2002
Location: Wichita, Kansas
Posts: 36
selecting text boxes

this seems like it should be easy, but I don't know how to do it.
I need to be able to select all of the text in a text box when it "gets focus". in other words, if you tab to it, you can type something new in it without highlighting it manually


anyone know how?
BustaCap is offline   Reply With Quote
Old 09-25-2002, 12:33 AM   #2
Member (12 bit)
 
Paul Victorey's Avatar
 
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
WHat language, compiler, etc?
Paul Victorey is offline   Reply With Quote
Old 09-25-2002, 09:06 AM   #3
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
If you are talking about text boxes in VB, you can use the SelStart and SelLength properties of the text box to set the location of the state of the selection and its length.
doctorgonzo is offline   Reply With Quote
Old 09-25-2002, 01:29 PM   #4
Member (6 bit)
 
BustaCap's Avatar
 
Join Date: Aug 2002
Location: Wichita, Kansas
Posts: 36
hehe, oops, I guess I forgot to tell you it was VB

ok, I had seen those properties, but I would like to knwo how to use them.
BustaCap is offline   Reply With Quote
Old 09-25-2002, 01:49 PM   #5
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Using the Enter event should work:

PHP Code:
Sub txtBob_Enter()
txtBob.SelStart=0
txtBob
.SelLength=Len(txtBob)
End Sub 
That will set the selection start point at 0 and select the entire length of whatever is in the box.
doctorgonzo is offline   Reply With Quote
Old 09-25-2002, 01:53 PM   #6
Member (6 bit)
 
BustaCap's Avatar
 
Join Date: Aug 2002
Location: Wichita, Kansas
Posts: 36
ok, simple as I thought

thanks
BustaCap is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:23 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2