Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Getting focus on form load

Getting focus on form load

Scheduled Pinned Locked Moved Visual Basic
databasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sa_runner
    wrote on last edited by
    #1

    Here is the basic layout. Inside of a group box, I have a textbox. Outside of the groupbox, I have a command button. On load, the command button has focus. I have tinkered with the tab index to put focus on the textbox when the form loads, but to no avail. The only answer I have now is to disable the command button until I have text in the textbox, but I don't know if that will put focus on the textbox initially. Ideas?! Thanks in advance.

    K 1 Reply Last reply
    0
    • S sa_runner

      Here is the basic layout. Inside of a group box, I have a textbox. Outside of the groupbox, I have a command button. On load, the command button has focus. I have tinkered with the tab index to put focus on the textbox when the form loads, but to no avail. The only answer I have now is to disable the command button until I have text in the textbox, but I don't know if that will put focus on the textbox initially. Ideas?! Thanks in advance.

      K Offline
      K Offline
      Kschuler
      wrote on last edited by
      #2

      Not sure, but here is what I'd do. When you are designing the layout of your form, go to the file menu and select View - Tab Order. This makes these little blue boxes with numbers appear next to each control. The numbers show the tab order...but when you have a group box, you have sort of like sub tab orders. So you need to first let the designer know that the Groupbox is the first item to have focus, then the textbox, then the command button. To do this, click on each of the controls in that order (watch the numbers change as you do it). Then from the file menu select View - Tab Order again to shut off the tab order view. If you mess up, just shut off the tab order view and then start it up again.

      S 1 Reply Last reply
      0
      • K Kschuler

        Not sure, but here is what I'd do. When you are designing the layout of your form, go to the file menu and select View - Tab Order. This makes these little blue boxes with numbers appear next to each control. The numbers show the tab order...but when you have a group box, you have sort of like sub tab orders. So you need to first let the designer know that the Groupbox is the first item to have focus, then the textbox, then the command button. To do this, click on each of the controls in that order (watch the numbers change as you do it). Then from the file menu select View - Tab Order again to shut off the tab order view. If you mess up, just shut off the tab order view and then start it up again.

        S Offline
        S Offline
        sa_runner
        wrote on last edited by
        #3

        I thought I had tried something similar, but I may not have. That gives me something to go on. I appreciate the help. Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups