Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 3: User Interface Design: Visual Basic Controls and Events
Last change: February 13 2016 18:47:26.

Setting the Tab Order

As stated at the beginning of this section, the tab order is the order in which the VB controls in a form receives their focuses when the user presses the Tab key. This order is determined by the control’s TabIndex property, which is initially set in the order the control is brought into the form. The first control brought to the form will have its TabIndex value set to 0. When you test your program, you may find the tab order not in accordance with your original design. In addition, when you are designing an interface with many data elements, you may have to insert controls into or delete controls from the form, making it necessary to adjust the tab order again.
You can set the TabIndex properties of these controls to the desired values. To set them to the desired order, follow these steps:

  1. Make sure the form appears in the IDE. Click the form so that it has the focus.
  2. Click the View menu in the menu bar.
  3. Select the Tab Order option. The form will display the current tab index for each control at the control’s upper left corner.
  4. Click each control in the order that you want it to receive focus, first one first. The new tab index value for each control will appear as you click. Figure 3-27 shows a form with the tab orders of the controls being reset.
  5. Click the Tab Order option under the View menu again to restore the form’s original appearance without the tab indices shown.

Figure 3-17
Setting tab orders

Last change: February 13 2016 18:47:28.