Does anyone know why Labels and Frames (and possibly other controls) have a TabIndex
property in VB6? Is there some use for it; some feature of GUI programming I ought to be incorporating in my applications (that I am blissfully unaware of)?
The following example uses the TabIndex property to display and set the tab order for individual controls. You can press Tab to reach the next control in the tab order and to display the TabIndex of that control. You can also click on a control to display its TabIndex.
The TabIndex property of a control determines where it's positioned in the tab order.
All controls have a TabIndex property. A control's border is determined by its BorderStyle property. Tab order is the order in which each control receives the focus when the user presses the Tab key. The Windows standard is to use sentence capitalization for identifying labels.
The tab order identifies the order in which controls receive the focus as the user tabs through a form or subform. The Cycle property determines the action to take when a user tabs from the last control in the tab order.
To confirm what Cody said in the comments. The VB6 manual entry for TabIndex says:
Controls that can't receive the focus (Frame and Label controls) remain in the tab order but are skipped during tabbing.
but
If you press the access key for a Frame or Label control, the focus moves to the next control in the tab order that can receive the focus.
TabIndex
is the property used to determine the sequence of focused controls when user presses TAB key.
If control with TabIndex=5
is focused and user presses TAB, control with TabIndex=6
will take focus.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With