TabBar Object
Parents Children Properties Methods Events
Purpose: To manage a set of TabBtn objects.

Description

The TabBar object manages a group of TabBtn objects. These are associated with a set of SubForm objects which are positioned on top of one another. When the user clicks on a TabBtn, the corresponding SubForm is brought to the top and given the focus.

TabBar and TabBtn objects were implemented before Windows provided direct support for tabbed dialogs, and have been superceded by TabControl and TabButton objects. Please use these instead.

By default, a TabBar is a flat bar stretched across the bottom of its parent form. You can alter its appearance using its EdgeStyle property and you can control its alignment with its Align property. Align can be set to Top, Bottom (the default), Left or Right and causes the TabBar to be attached to the corresponding edge of the Form. A TabBar aligned Top or Bottom will automatically stretch or shrink horizontally when its parent Form is resized, but it will remain fixed vertically. A TabBar aligned Left or Right will stretch vertically but will remain fixed horizontally. By default a TabBar occupies the entire width or length of the side of the Form to which it is attached. Both the Posn and Size properties can be altered.

 

The alignment of a TabBar also determines the orientation of its TabBtns. TabBars aligned Top or Bottom cause their TabBtns to be drawn left to right with the free edge of the TabBtns facing downwards or upwards respectively. TabBar aligned Left or Right draw their TabBtns downwards with their free edges facing left or right respectively.

By default, TabBtn objects are positioned along the inner edge of the TabBar. This is the edge closest to the SubForm s they will tab. They are also positioned so that they overlap one another horizontally or vertically according to the Align property.

The HScroll and VScroll properties determine what happens when the end of the TabBar is reached. If HScroll or VScroll is 0 (the default) a TabBtn that would otherwise extend beyond the TabBar is instead positioned immediately above, below or alongside the first TabBtn in the TabBar, thereby starting a new row or column. Note however that the TabBar is not automatically resized vertically to accommodate a second row or column. If you want a multi-flight TabBar you have to set its height or width explicitly. If HScroll or VScroll is ¯1 or ¯2, TabBtns continue to be added along the TabBar even though they extend beyond its boundary and may be scrolled into view using a mini scrollbar. If HScroll is ¯1, the scrollbar is shown whether or not any controls extend beyond the TabBar. If HScroll is ¯2, the scrollbar appears only if required and may appear or disappear when the user resizes the parent Form.

VScroll and HScroll may only be set when the object is created and may not subsequently be changed.

If you specify a value for its Posn property, a TabBtn will be placed at the requested position regardless of the value of Style, HScroll or VScroll. However, the next control added will take its default position from the previous one according to the value of these properties. Thus if you wish to group your controls together with spaces between the groups, you need only specify the position of the first one in each group.

If you specify a value for its Posn property, a TabBtn will be placed at the requested position regardless of the value of Align. However, the next TabBtn added will take its default position from the previous one. Thus if you wish to group your TabBtns together with spaces between the groups, you need only specify the position of the first one in each group.