Contact Sales

Call center available M-F 9:00 - 4:00 US Eastern Time.

Case Studies

Datasoft Solutions

Datasoft Solutions selected Xtreme Toolkit Professional with Visual C++ over many...

Adding Multi-Row Tabs

Author: Mike Palmatier
Posted: May 3, 2008
Environment: Visual Basic 6.0

Downloads:
 tabMultiRow.zip - Source Files with Demo Project [7 KB]

The TabControl can display more than one row of tabs by changing the Layout property to xtpTabLayoutMultiRow. The number of rows is automatically set by the width and number of the tabs. The number of rows can change if the control is resized, which ensures that the tabs wrap to the next row. If the tab layout is not set to xtpTabLayoutMultiRow, and the last tab exceeds the width of the control, left and right arrow buttons are added at the right end of the TabControl.

    'The TabControl can display more than one row of tabs

    'by changing the Layout to xtpTabLayoutMultiRow.

    TabControl.PaintManager.Layout = xtpTabLayoutMultiRow

The MultiRowJustified property specifies the justification of the tabs in the TabControl. When True, each tab is wide enough to accommodate its caption and, if needed, the width of each tab is increased so that each row of tabs spans the width of the TabControl. This will stretch each row of tabs to fill the entire width of the TabControl.

If False, the tab rows will be non-justified. Each tab is just wide enough to accommodate its caption. The rows are not justified, so multiple rows of tabs are "jagged".

    'The MultiRowJustified property specifies the

    'justification of the tabs in the TabControl.

    TabControl.PaintManager.MultiRowJustified = True

The MultiRowFixedSelection property specifies whether the the row of the currently selected tab will be moved to the front of the tab rows. This determines how remaining rows of tabs in front of a selected tab are repositioned.

When False, the rows of tabs in front of the selected tab are repositioned at the opposite side (behind) of the control. For example, if there are three rows in the multi-row tab-control, and a tab in the second row is selected, all tab rows will be repositioned behind the second row.

When True, the rows in a multi-row tab control remain "fixed" when a tab is selected. The remaining rows of tabs in front of a selected tab will not be repositioned. For example, if there are three rows in the multi-row tab-control, and a tab in the second row is selected, the tab rows will remain the same.

    'specifies whether the the row of the currently selected

    'tab will be moved to the front of the tab rows.  This

    'determines how remaining rows of tabs in front of a

    'selected tab are repositioned.

    TabControl.PaintManager.MultiRowFixedSelection = False