Customizing the Tab control

The Tab control has settings for controlling the position and appearance of the tabs. Each tab can have its own label, picture, and background color.

All tabs share the same font settings, which you set on the Tab control’s Font property page.

Pop-up menus and Properties views for Tab controls and tab pages

A Tab control has several elements, each with its own pop-up menu and Properties view. To open the Properties view, double-click or select Properties on the pop-up menu.

Where you click determines what element you access.

Table 5-1: Accessing Tab control elements

To access the pop-up menu or Properties view for a

Do this

Tab control

Right-click or double-click in the tab area of the Tab control

Tab page

Click the tab to make the tab page active, then right-click or double-click somewhere in the tab page but not on a control on the page

Control on a tab page

Click the tab to make the tab page active and right-click or double-click the control

Position and size of tabs

The General tab in the Tab control’s Properties view has several settings for controlling the position and size of the tabs. For example:

Table 5-2: Controlling size and position of tabs

To change

Change the value for

The side(s) of the Tab control on which the tabs appear

Tab Position

The size of the tabs relative to the size of the Tab control

Ragged Right, MultiLine, Fixed Width

The orientation of the text relative to the side of the Tab control (use this setting with caution—only TrueType fonts support perpendicular text)

Perpendicular Text

NoteFixed Width and Ragged Right When Fixed Width is checked, the tabs are all the same size. This is different from turning Ragged Right off, which stretches the tabs to fill the edge of the Tab control, like justified text. The effect is the same if all the tab labels are short, but if you have a mix of long and short labels, justified labels can be different sizes unless Fixed Width is on.

The sample Tab control in Figure 5-2 is set up like an address book. It has tabs that flip between the left and right sides. With the Bold Selected Text setting on and the changing tab positions, it is easy to see which tab is selected.

Figure 5-2: Address book tab control

The sample Tab control shows a page of employees listed alphabetically. Tabs running along the upper left and lower right of the list offer ranges of letters such as a through c that the user can select to display a different page of the list. The last tab on the left is the one selected. Its range of letters is bolded. The ones that follow it are displayed on the right.

Tab labels

You can change the appearance of the tab using the Properties views of both the Tab control and the Tab page.

Table 5-3: Changing the appearance of a tab

Properties view

Property page

Setting

Affects

Tab control

General

PictureOnRight, ShowPicture, ShowText

All tabs in the control

Tab page

General

Text, BackColor

The label on the tab and the background color of the tab page

Tab page

TabPage

PictureName, TabTextColor, TabBackColor, PictureMaskColor

The color of the text and picture on the tab and the background color of the tab itself (not the tab page)

If you are working in the User Object painter on an object you will use as a tab page, you can make the same settings on the TabPage page of the user object’s Properties view that you can make in the tab page’s Properties view.

This example has a picture and text assigned to each tab page. Each tab has a different background color. The Show Picture and Show Text settings are both on:

Figure 5-3: Tabs with pictures and text

Three tabs display horizontally, each with an icon and a word to indicate the tab’s function, such as the word Query and a picture of binoculars.

Changing tab appearance in scripts

All these settings in the painter have equivalent properties that you can set in a script, allowing you to dynamically change the appearance of the Tab control during execution.