Consulting

Results 1 to 7 of 7

Thread: Putting the cursor into the textbox

  1. #1

    Putting the cursor into the textbox

    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?

  2. #2
    VBAX Regular
    Joined
    May 2004
    Location
    Seattle, WA
    Posts
    24
    Location
    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.

  3. #3
    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?

  4. #4
    VBAX Regular
    Joined
    May 2004
    Location
    Seattle, WA
    Posts
    24
    Location
    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?

  5. #5
    sounds good...will check again later. Thanks

  6. #6
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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

  7. #7
    VBAX Regular Hammer300's Avatar
    Joined
    Aug 2004
    Location
    Queensland, Australia
    Posts
    15
    Location
    Was this post ever solved????

    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •