Tabbed dialogs

From HashVB
Revision as of 00:49, 19 November 2005 by Dee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
float
 This article is based on Visual Basic 6. Find other Visual Basic 6 articles.

There are some nice UI features in Windows called tabbed dialogs. In VB, there are two built in ways of implementing your own: The SSTab control, also known as the Microsoft Tabbed Dialog Control (This used to be the Sheridan tab control), and the TabStrip, part of Windows Common Controls. Out of these two, the TabStrip is a much better option despite having to deal with switching tabs yourself.

Problems with the SSTab control

The SSTab control has a nice feature of allowing you to switch tabs and place controls at runtime, but this comes at a price. When you change tab, the controls aren't actually hidden, but moved a long way off to the left. This has the undesired side affect of keeping them in the tab order and accessible (although out of sight).

One container per tab

To get around the problems with the SSTab and to make the TabStrip usable, you will need to put each "page" of controls onto an individual frame control (with the border removed). You can then hide and show these as the relevant tab is selected.

Different styles

With the prevalence of Windows XP and customisable window themes, You can make your Tab dialog use the same style, by making sure you use the VB5 version of the Windows Common Controls, and follow the rest of the instructions on applying the XP style to your application.

See also