TabIndex property not working for me

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • michael sorens

    TabIndex property not working for me

    I have a form with a variety of controls (TextBox, CheckBox, and Button).
    I have assigned TabIndex values starting from 1 at the top, working my way
    down the form to 15 at the bottom. Each of these has TabStop set to true.
    When I run the application and repeatedly press the tab key, the on-screen
    focus order is very different than what I thought I specified. If it
    matters, here is the general layout of my form. As you'll observer, most
    of the controls are within separate Panels, except for the main ok and
    cancel buttons which are outside the TabControl. What am I doing wrong?

    Form
    TabControl
    TabPage
    TableLayoutPane l
    Panel
    Label
    TextBox
    Panel
    Label
    TextBox
    Panel
    CheckBox
    TextBox
    Panel
    Label
    TextBox
    Panel
    Label
    TextBox
    okButton
    cancelButton
  • Linda Liu [MSFT]

    #2
    RE: TabIndex property not working for me

    Hi Michael,
    Thank you for posting. From your post, my understanding on this issue is:
    When you run your application and press the Tab key repeatedly, you can not
    get proper focus order on your form. If I¡¯m off base, feel free to let me
    know.
    Since some controls such as Label TextBox are put into a Panel in your
    project, the Panel¡¯s TabIndex property should be set properly first. For
    example, there are four Panels on your form and each Panel contains several
    controls. To get proper focus order, the four Panels¡¯ TabIndex properties
    should be set to sequent numbers and the TabIndex properties of the
    controls in one Panel should be set to sequent numbers too.
    Please let me know if you have any other concerns, or need anything else.

    Sincerely,
    Linda Liu
    Microsoft Online Community Support

    =============== =============== =============== =======
    When responding to posts,please "Reply to Group" via
    your newsreader so that others may learn and benefit
    from your issue.
    =============== =============== =============== =======

    Comment

    • michael sorens

      #3
      Re: TabIndex property not working for me

      Thank you for the response. Working from your input, I now understood how
      TabIndex properties nest with the nesting of components. (This is not at
      all clear in the documentation.) So top level components must be numbered
      0, 1, 2, etc. Then within those components, one starts renumbering again
      from 0. So one might end up with, for example:
      0.0, 0.1, 0.2, 1, 2.0, 2.1, 3, 4.0, 4.1, 5.0, 5.1, 5.1.1, 5.1.2, 5.2,
      5.3
      When the user tabs through a form, these numbers are simply consumed from
      lowest to highest. Thus, since 4.1 is smaller than 5.0, the control at 4.1
      will be reached before the one at 5.0.

      On Tue, 11 Apr 2006 01:33:33 -0700, Linda Liu [MSFT]
      <v-lliu@online.mic rosoft.com> wrote:
      [color=blue]
      > Hi Michael,
      > Thank you for posting. From your post, my understanding on this issue
      > is:
      > When you run your application and press the Tab key repeatedly, you can
      > not
      > get proper focus order on your form. If I¡¯m off base, feel free to let
      > me
      > know.
      > Since some controls such as Label TextBox are put into a Panel in your
      > project, the Panel¡¯s TabIndex property should be set properly first. For
      > example, there are four Panels on your form and each Panel contains
      > several
      > controls. To get proper focus order, the four Panels¡¯ TabIndex
      > properties
      > should be set to sequent numbers and the TabIndex properties of the
      > controls in one Panel should be set to sequent numbers too.
      > Please let me know if you have any other concerns, or need anything
      > else.
      >
      > Sincerely,
      > Linda Liu
      > Microsoft Online Community Support
      >
      > =============== =============== =============== =======
      > When responding to posts,please "Reply to Group" via
      > your newsreader so that others may learn and benefit
      > from your issue.
      > =============== =============== =============== =======
      >[/color]

      Comment

      • Linda Liu [MSFT]

        #4
        Re: TabIndex property not working for me

        Hi Michael,
        I am glad to heart that the problem has been fixed. If you have any other
        questions or concerns, please do not hesitate to contact us. It is always
        our pleasure to be of assistance.
        Have a nice day!



        Sincerely,
        Linda Liu
        Microsoft Online Community Support

        =============== =============== =============== =======
        When responding to posts,please "Reply to Group" via
        your newsreader so that others may learn and benefit
        from your issue.
        =============== =============== =============== =======

        Comment

        • lokhande.praveen@gmail.com

          #5
          Re: TabIndex property not working for me

          The TabIndex property is of type int and not float/double. How would
          one indexes of nested component to say 0.0., 0.1 etc.

          Comment

          • Jon Skeet [C# MVP]

            #6
            Re: TabIndex property not working for me

            <lokhande.prave en@gmail.com> wrote:[color=blue]
            > The TabIndex property is of type int and not float/double. How would
            > one indexes of nested component to say 0.0., 0.1 etc.[/color]

            I think the point is that the top-level component has index 0, then the
            components within it have 0 and 1 to get effective indexes of 0.0 and
            0.1, etc.

            --
            Jon Skeet - <skeet@pobox.co m>
            http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
            If replying to the group, please do not mail me too

            Comment

            Working...