Set Tab Order in a Hurry

Setting up the control tab order can be unruly-a sore point with many VB developers. In fact, in Jeff Hadfield’s recent editorial, “Five Things You Hate About VB6” [Editor’s Note, VBPJ April 1999], it’s listed as one of the top five things people hate most about VB.

I’ve never understood this; it’s never been a big deal to me. But many people are shocked when I show them how I lay out tab orders, and are even embarrassed they didn’t think of it themselves. I don’t worry about the tab order until I’ve placed all the controls on the form, then I order them.

Now for the slam in the face: Think backwards. While viewing your form, click on the control you want to be the last control in the tab order. Highlight the TabIndex property in the Properties window and change it to zero. Now click on the control that you want to have the focus before that one, and repeat the process. Repeat this process until you reach the control that should have focus when the form opens.

Here’s why this works: VB does most of the work for you. VB automatically reassigns the tab orders if you change the TabIndex property of a control. Because you started by setting the tab index of the last control first, VB increments the last control’s tab index as you set the rest of the controls. It’s a heck of a lot easier to set the tab index to zero while you’re going through the order. I can rip through a form with more than 50 controls in about two minutes using this technique.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may