1

I've got a form with several controls on them (TextBox, CheckBox, ComboBox, NumericUpDown, DateTimePicker, and Button).

I have assigned them all TabIndex values, from left-to-right, top-to-bottom (1..25).

The controls are organized into Panels. The first control in the top panel has the focus first; tabbing from there goes through the first panel just fine, but then jumps over the second and third panels to the fourth panel (skipping TabIndex 11..15 on panels 2 and 3 and going to TabIndex 16 on panel 4).

All of the controls have TabStop set to True; all of the Panels have TabStop set to False.

Why are my controls on panels 2 and 3 being bypassed?

UPDATE

TnTinMn inspired me to check it out; I had never noticed that option before. Here is what my form looks like with that view:

enter image description here

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

1

This seems somewhat macabre, wacky even, but I had to give the Panels TabIndex values in incrementing values for it to work. That is to say, after I gave the first Panel a TabIndex of 0, the second panel 1, etc., it worked - even though they are all set to TabStop = false.

Seems bizarre to me that an unstopped location is considered at all in the tabbing scheme of things.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    I may have misunderstood, but what you're describing is the default and correct behavior of tab-stops and tab-indexes. – dotNET Apr 05 '17 at 17:31
  • It sounds like you are assigning the tab order via the property grid or setting via user code. If you do it via the designer (toggle this mode using: View Menu->Tab Order), you will see the structure for WInForm Tab order. For each container control, the child control TabIndex starts at one (1). The Form is the primary container and each panel are second level containers. In the designer, repeatedly click on the displayed order number to change it. The designer is not intuitive. – TnTinMn Apr 05 '17 at 18:51
  • Interesting, Tennessee Tin Man; I will add what I see now in an Update. – B. Clay Shannon-B. Crow Raven Apr 05 '17 at 20:14