SelStart Property Question

G

Guest

Hello,

When a user enters a control I want to be able for the Cursor to start at
the first position.

So I have...

Private Sub txtName_GotFocus()
txtName.SelStart = 0
End Sub

This works. However when I do the same for a ComboBox control it doesnt
work when the user "Clicks" on the ComboBox. It highlights the 1st position
but doesnt move the Cursor to the 1st position.

I have..

Private Sub cmboFromDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
cmboFromDate.SelStart = 0
End Sub

How can this be done with a Combo Box ?

Any help would be greatly appreciated.

Thank you,
Jeff
 
G

Guest

you need to use setfocus to move the cursor to the control

Me.txtName.SetFocus
txtName.SetFocus
cmboFromDate.SetFocus

'you can use me. or the name of the form name or like how u did it without
any form
'name just the name of the control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top