Methods | This Package | All Packages

ScrollBar Class

Represents the base class for scroll bar controls.

Control
  |
  +--ScrollBar

package com.ms.wfc.ui

public abstract class ScrollBar
extends
Control

Remarks

This class implements the base functionality for all scroll bars controls.

Note   Because the ScrollBar class is abstract, you must use a subclass to create a scroll bar control. Classes that extend ScrollBar include HScrollBar and VScrollBar, which implement horizontal and vertical scroll bars, respectively.

When you add a scroll bar control to a form, you should bring the scroll bar to the front of the z-order of the controls on the form. This ensures that the scroll bar is always drawn on top of the other controls. For example, if you anchor a control to the right side of the form and then resize the form to a smaller width, this control may appear on top of the scroll bar. To set the scroll bar at the front of the z-order in the Forms Designer, right-click the scroll bar control on the form and click Bring to Front on the shortcut menu. To set the scroll bar at the front of the z-order in code, call its bringToFront method.

To display scroll bars for the form itself, you can either explicitly use a scroll bar control or set the autoScroll property of the form. When you set the form's autoScoll property to true, horizontal and vertical scroll bars are automatically displayed when needed, and are excluded from the client area of the form. However, if you explicitly add a scroll bar control, the scroll bar is always displayed and is included in the form's client area. Therefore, to determine the area that is actually available for drawing on the form, you must manually subtract the height of the horizontal scroll bar and the width of the vertical scroll bar.

See Also   ScrollEvent, ScrollEventType