Click to See Complete Forum and Search --> : Combobox - Highlight Text


ClaireDH
May 22nd, 2001, 09:05 AM
I have a simple form with a combobox and two text fields as well as two command buttons. I want to highlight the text in the text field portion of the combobox and move the cursor to that field. Anybody able to help me do this?

Thanks!

Claire

cksiow
May 22nd, 2001, 09:29 AM
check on the property .SelLength & .SelStart

.SelStart should be able to move the cursor

HTH

cksiow
http://vblib.virtualave.net - share our codes

mwatkins
May 22nd, 2001, 09:30 AM
How about something like this?


private Sub Command1_Click()

Dim Color as ColorConstants
Color = vbYellow

Combo1.BackColor = Color
Combo1.SetFocus

End Sub




Or if you wanted to highlight just the text and not the backcolor then you would use the forecolor property instead.

Hope this helps


Mike Watkins
CodeSprings, inc.
Quality Assurance