Results 1 to 8 of 8

Thread: set focus

  1. #1

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    I want to place a command in the form_load event to put the cursor in a text box.
    My intention is that when someone runs the program they can just start typing, rather then click the mouse in the text box before they can type.
    how can I do this?

    ------------------
    I am so skeptacle, I can hardly believe it!

  2. #2

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    never mind I am a tard!!!!

  3. #3
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    Just use the statement on the load of the form: text_box1.SetFocus

  4. #4

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    janitor that doesn't work in the form_load event unless it has the me.show before the setfocus command. That was my problem, I did not have the me.show command in form load

    [This message has been edited by badgers (edited 01-05-2000).]

  5. #5
    Lively Member
    Join Date
    Jan 2000
    Posts
    123

    Post

    Actually I think you can just set one of the properties in the porperties window to default the text box. I forget which one and I maybe wrong about the fact althogether! Does someone wish to correct me?

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    You would actually probably be better of putting it in Form_Activate. Putting it there eliminates any need for Me.Show, and, if you have the kind of app where this form is hidden and then shown again, your textbox will have the focus.

    ------------------
    Marty

  7. #7

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    thank you that is a good idea!

  8. #8
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Why don't you just set the Textbox's TabIndex to Zero?
    Then it'll have Focus when the Form Loads.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


Posting Permissions

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



Click Here to Expand Forum to Full Width