|
-
August 13th, 1999, 11:12 AM
#1
Text highlighted
I want to highlight a text in a Textbox control.
¿What may I to make?
-
August 13th, 1999, 01:46 PM
#2
Re: Text highlighted
Take a look at the 'SelStart' and other textbox related properties in the VB Help files
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
August 13th, 1999, 05:10 PM
#3
Re: Text highlighted
Use the SelLength,SelStart,SelText object properties. The following code will highlight the text in a text box from beginning to end. Just substitute the name of your text box.
textbox.SelStart = 0
txtbox.SelLength = len(textbox.Text)
Cheers for now
Charlie
-
August 14th, 1999, 01:24 AM
#4
Re: Text highlighted
Just use the following lines of code. (Assuming the tectbox is called txtName.......
txtName.SelStart=0
txtName.SelLength=len(txtName)
Enjoy........
-
August 16th, 1999, 01:52 AM
#5
My favorite...
This is one of my favorites:
(try this on "click" or even on "gotfocus" event)
SendKeys "{home}+{end}"
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900
-
August 17th, 1999, 07:22 AM
#6
-
August 17th, 1999, 07:34 AM
#7
-
August 20th, 1999, 11:04 PM
#8
Re: Text highlighted
Autoselect Text
To make a TextBox automatically select its text when focus enters it, give it a GotFocus event handler like this:
Private Sub Text1_GotFocus()
SendKeys "{home}+{end}"
End Sub
Or use SelStart and SelLength:
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
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
|