OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Constructing Scroll Bars

TScrollBar has a constructor that takes the seven parameters commonly found in a control object constructor (a parent window, a resource identifier, the control's x, y, h, and w dimensions, and an optional module pointer), and also takes a bool flag parameter that specifies whether the scroll bar is horizontal.

Here's a TScrollBar constructor declaration:

TScrollBar(TWindow *parent, int resourceId,
int x, int y, int w, int h, bool isHScrollBar, TModule *module = 0);

If you specify a height of zero for a horizontal scroll bar or a width of zero for a vertical scroll bar, Windows gives it a standard height and width. The following code creates a standard-height horizontal scroll bar:

new TScrollBar(this, ID_THERMOMETER, 100, 150,
180, 0, true);

TScrollBar's constructor constructs scroll bars with the style SBS_HORZ for horizontal scroll bars and SBS_VERT for vertical scroll bars. You can specify additional styles, such as SBS_TOPALIGN, by changing the scroll bar object's Attr.Style.

See Also