Setting Tab Order

See Also1JVHZEV

By default, Visual Basic assigns tab order to controlsXX9KJT in the order you draw them on a form5272EF.  Each new control is placed last in the tab order.  To allow you to control the order that controls gain focus in your application, you can change the tab order at design time with the Properties windowO00AW8, or at run time through code.

To change tab order at design time

   1. Click a control to select it.

   2. From the Properties window1K6JQPY, select TabIndex.

     Visual Basic displays the current tab position in the Settings boxAV4YN4.

   3. Type the number for the tab order position you want the control to have.

   4. Click the Enter button1MFBOJ1.

     You can test the tab order at design time by pressing Tab.

 

To enable or disable a tab stop at design time

   1. Click a control to select it.

   2. From the Properties window, select TabStop.

     Visual Basic displays the current Boolean62VG080 value in the Settings box.

   3. Select True to designate the control as a tab stop, or select False to bypass the control in the tab order.

   4. Click the Enter button.

 

Note   When you change a control's tab order position, Visual Basic automatically renumbers the tab order positions of other controls to reflect insertions and deletions.

A control whose TabStop property has been set to False maintains its position in the actual tab order as set by the TabIndex property, even though the control is skipped when you cycle through the controls with the Tab key.

 


See Also

Help:

TabIndex PropertyH38QPT

TabStop Property81MAWZ

 

Programmer's Guide:

Chapter 3, "Creating and Using Controls"