Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab index does not work with controls in panels?

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.

like image 434
TypeM1smatch Avatar asked Apr 17 '13 14:04

TypeM1smatch


2 Answers

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.

like image 119
dizzy.stackoverflow Avatar answered Nov 10 '22 17:11

dizzy.stackoverflow


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.

Name         Parent        TabOrder        TabStop
=======================================================
Form         -             0               -
TabStrip1    Form          1               True
Tab1         TabStrip1     2               True
Label1       Tab1          3               False
Textbox1     Tab1          4               True
Label2       Tab1          5               False
Combo1       Tab1          6               True

Tab2         TabStrip1     7               True
Label3       Tab2          8               False
Textbox2     Tab2          9               True
Label4       Tab2          10              False
Combo2       Tab2          11              True

Tab3         TabStrip1     12               True
Label5       Tab3          13               False
Textbox3     Tab3          14               True
Label6       Tab3          15               False
Combo3       Tab3          16               True
like image 21
Zeddy Avatar answered Nov 10 '22 19:11

Zeddy