How to Easily Set Up the Tab Sequence of a Form

Last reviewed: July 11, 1996
Article ID: Q153308
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic for Windows, 16-bit and 32-bit, version 4.0

SUMMARY

The TAB key is often used to navigate sequentially through multiple controls on a form. The order in which you move through the controls depends on their TabIndex value, not their position on the form. This article provides you with a simple method you can use to set up a required tab sequence.

MORE INFORMATION

By default, the TabIndex property is set when you place a control on a form relative to the other controls on the form. To set up a required tab sequence, in the design environment, select the control you wish to be last in the tab sequence. Set its TabIndex to Zero. Select each control in the opposite direction from that which the user will use to navigate through the form, and set each control's TabIndex to Zero.

Each time you set the TabIndex for a control, all the other controls have their TabIndex recalculated so as you set them to Zero all the other controls are incremented by one.

REFERENCES

ARTICLE-ID: Q142816

TITLE     : How to Make ENTER Key Move Focus Like TAB Key for VB Controls


Additional reference words: 4.00 vb4win vb4all
KBCategory: kbusage kbhowto
KBSubcategory:



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 11, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.