PDA

View Full Version : Sleeper: Putting the cursor into the textbox



johnjasmines
06-14-2004, 09:53 AM
I can't figure this one out, and I know it is probably pretty simple to do. I wrote an application that has text boxes for user input. I know that a person can simply take the mouse and put the cursor in the textbox, but how can I get it there for them. I also have an option list that allows them to click a letter not in the 26-letter character list, but after they click on it and insert it into the box, the cursor disappears and the user manually has to put it there. Is there a user-friendly way of keeping it there?

xXLdev
06-14-2004, 10:18 AM
I am assuming the textboxes are in a form. If so, you can use textbox1.SetFocus.

I do not understand your second question. Could you reword it? Or does using SetFocus solve both problems.

johnjasmines
06-14-2004, 10:34 AM
It works for the first question. The text box requires input from a user and some of the characters (foreign language) are not part of the 26-letter alphabet. Thus, I made an option that if you click on the option it will insert the additional character into the textbox, yet when I do so, the cursor disappears and the user has to reinsert it. Does that make sense?

xXLdev
06-14-2004, 10:42 AM
I think that SetFocus will still work for you. When that if you click on the option, I assume that you execute some code to insert the foreign characters into the textbox. At the end of that code you should be able to do a SetFocus.

Or am I still not getting it?

johnjasmines
06-14-2004, 10:48 AM
sounds good...will check again later. Thanks

Zack Barresse
06-14-2004, 11:24 AM
Sounds like you could probably right click your option button, View Code, then do the .SetFocus bit.

Maybe something like this..??:


Private Sub OptionButton1_Click()
If OptionButton1 = True Then
TextBox1.SetFocus
End If
End Sub

Hammer300
08-25-2004, 12:30 AM
Was this post ever solved????

Rob