Tabs are containers that can hold zero, one or several parts, such as text, images, buttons, checkboxes, radiobuttons, progressbars, and more.
Most tabs show a text and possibly an image. The TabClass.Text property defines the text and the TabClass.Image property defines the image. An image can also be taken from an image list, using the TabClass.ImageList and TabClass.ImageIndex properties.
An ampersand (&) in front of a character of the text defines the character as the tab's mnemonic: the character is underlined and the tab can be selected by pressing Alt and the character (see Keyboard Interface). Two ampersands (&&) display one ampersand.
The text can consist of several lines, separated by line breaks. If the text does not fit its tab, it ends with an ellipsis, and the complete text is then shown as the tab's tooltip (see Tooltips). With the SftTabs.DropText property set to True, the text of all tabs is hidden when the tabs do not fit.
The SftTabs.BoldSelected property defines whether the text of the selected tab is bold. The SftTabs.TabPadding property defines the space between the edges of a tab and its contents.
The text and the image of a tab are parts in the tab's parts collection, which is accessed using the CellBaseClass.Parts property. The TabClass.Text property accesses the first text part (TextPartClass) of the parts collection, the TabClass.Image property the first image part (ImagePartClass). When a text or an image is assigned and the parts collection does not have a matching part yet, the part is added at the end of the parts collection.
The parts are displayed in the order of the parts collection, along the direction of the tab's text. A tab whose image is defined before its text shows the image first; a tab created with a text and an image shows the text first. The PartsCollectionClass.MoveUp and PartsCollectionClass.MoveDown methods change the order of the parts.
These parts are available:
When the user clicks a part of a tab, the PartClicked event occurs. In addition, each part offers the GenericPartClass.Action event.
At design-time, the parts of a tab are defined using the Tab Edit Dialog.
See Also Tab Control Components