1. Technology
Send to a Friend via Email
Save Time and Trouble Using Frames on ssTab Control
Frames make ssTab much more useful!

The default Toolbox in VB doesn't include some of the most useful components. One of those that is left out is the ssTab control ... otherwise known as the Microsoft Tabbed Dialog Control. But this control can have hidden "gotcha's" when you use it. Here's how to avoid some of the problems.

Before you can use the ssTab control, it must be added to the Toolbox. There are several ways to do this. One is to right-click in the body of the Toolbox and select Components ... . Another is to select Components ... from the Project menu or press Ctrl-T. All of these will result in the Components dialog. (An excellent example of a tabbed dialog control!)

The ssTab Control
 Join the Discussion
This tip was suggested by a thread started by Mike Zilahy.
Add your comments here.
SSTab control
 

When the ssTab control is selected, it will appear in the Toolbox just like any other VB component.

Although the tabbed dialog is a powerful tool, it can be misused very easily. Even Microsoft gets carried away and creates tabbed dialogs that are simply confusing rather than helpful. Isys Information Architects has collected a whole gallery of examples of how not to use the tabbed dialog control.

The Components Dialog

But there are more subtle things that can also go wrong with the ssTab control.

One problem is that under certain conditions, the Tab key can switch to controls that are not on the ssTab control. This strange behavior happens because the ssTab control actually works by simply moving the invisible tabs off the screen. There are actually two "fixes" for this problem. One is to enclose all the controls on each tab in a single frame and activate the frame synchronously with the tab and the other is to test whether a tab is off the screen or not and change your program logic accordingly. Using a frame on each tab is the top recommendation because it's simpler to accomplish, and because it also solves a few other problems, including the problem reported by Mike Zilahy in the message board. The first solution is explained on this page. The second one can be found here.

Don't even think of using this control outside of Visual Basic. It's just not supported and will probably cause problems sooner or later.

©2014 About.com. All rights reserved.