Make a Text Box Value Highlight

Make a Text Box Value Highlight

Anonymous
Not applicable
411 Views
7 Replies
Message 1 of 8

Make a Text Box Value Highlight

Anonymous
Not applicable
I have a text box with a default value set that is the first tab index on a dialog that shows upt. I'd like to have that value automatically highlight when the dialog is initiated.
Any help?

Thanks so much,
FX
0 Likes
412 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Look into the SelStart and SelLength properties of the TextBox object.

Repost if you need more info (I don't have a sample handy).

wrote in message news:5452970@discussion.autodesk.com...
I have a text box with a default value set that is the first tab index on a
dialog that shows upt. I'd like to have that value automatically highlight
when the dialog is initiated.
Any help?

Thanks so much,
FX
0 Likes
Message 3 of 8

Anonymous
Not applicable
I found something that I taylored to my purposes, but I get a "Compiled Error" message:

Private Sub Highlight_Layer()
If ("Highlight" means "Selected") then
txtLayerName.SelStart = 0
txtLayerName.SelLength = Len(txtLayerName.Text)
txtLayerName.SetFocus
End If

End Sub
0 Likes
Message 4 of 8

Anonymous
Not applicable
I have no idea what the line below is supposed to be. I'm no expert, so it
could by ignorance, but I've never seen a condition statement like that
before. What is it supposed to do?

If ("Highlight" means "Selected") then

wrote in message news:5453002@discussion.autodesk.com...
I found something that I taylored to my purposes, but I get a "Compiled
Error" message:

Private Sub Highlight_Layer()
If ("Highlight" means "Selected") then
txtLayerName.SelStart = 0
txtLayerName.SelLength = Len(txtLayerName.Text)
txtLayerName.SetFocus
End If

End Sub
0 Likes
Message 5 of 8

Anonymous
Not applicable
I dunno...I saw it in this thread:
http://discussion.autodesk.com/thread.jspa?messageID=381475

With or with out it, I can't get it to work.
0 Likes
Message 6 of 8

Anonymous
Not applicable
You must to put some text before
in this Textbox
See my example
Hth

~'J'~
0 Likes
Message 7 of 8

Anonymous
Not applicable
Thanks Fatty...that worked just fine!
0 Likes
Message 8 of 8

Anonymous
Not applicable
You are welcome
Happy computing 🙂

~'J'~
0 Likes