I have a vb.net windows form with about 15 comboboxes and 15 textboxes, along with several other controls. All of these TextBoxes
and ComboBoxes
are located in panels. The reason for this is I need to adjust the visible property of controls based upon what the user selects/enters, so grouping each label and control together in their own panels seemed like an easy way to accomplish this.
I've set the tab order via properties, but it doesn't work. When I tab through my form, it skips around and does not follow the tab order that I've set. Is this because my controls are each located in separate panels? I've set TabStop
to false for everything I don't want a tabstop on, I'm a little confused about what's going on here. It really seems that the fact that my ComboBoxes
and TextBoxes
are each inside their own panels is preventing my tab indices to work. Can anyone confirm this or have other ideas of what may be happening? TabIndex
works if I create a new form.
Setting TabStop to FALSE means it will skipped by when its turn comes in the Tab Order. Normally you would set TabStop for LABELs to FALSE and all other INTERACTIVE Controls to TABSTOP = True (unless the control is disabled off course).
Dont skip from Tab to Tab. Your TabStop and Tab Order ought to be something like the list below.
I have found that you have to look at EVERY tab index for each control and grouping of controls (group box, panel, whatever). Unlike Classic VB, .Net doesn't update all the other tab indices for you. You can have as many controls as you want with the same tab index on a form, panel, or other grouping type.
BTW, for those that posted the View - Tab Order menu item, thank you. I didn't know it was there and it helped me immensely to properly order a form I have with multiple nested group boxes. This was an excellent tool for reviewing the tab order. If you use this, be sure to pay attention to each level of nesting.
Believe it or not, the panel ordering absolutely DOES affect the TabIndex. I have found that the easiest way to deal with tab ordering on a multi-panel form is to use View>Tab Order as suggested by LarsTech. Then once the tab ordering is visible, you'll be able to see how the panels affect the overall ordering of the controls contained in each panel. Next, left-click one at a time on the actual panels, in the order that you want the flow to go. You'll notice that it will then automatically sub-order the controls inside each panel, with the overall panel ordering be in the order that you specified. Once this is done you can then click on each control inside each panel to set a control's relative tab order inside a given panel.
Try using "View - Tab Order" in the Visual Studio designer and click each container and control in the order you want. The tab index of the parent container (panels) matters.