System.Windows.Forms.ScrollableControl Class

Defines a base class for controls that support auto-scrolling behavior.

See Also: ScrollableControl Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.ComponentModel.Designer("System.Windows.Forms.Design.ScrollableControlDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
public class ScrollableControl : Control

Remarks

You do not typically use the System.Windows.Forms.ScrollableControl class directly. The System.Windows.Forms.ContainerControl and System.Windows.Forms.Panel classes inherit from this class.

The System.Windows.Forms.ScrollableControl class acts as a base class for controls that require the ability to scroll. To enable a control to display scroll bars as needed, set the ScrollableControl.AutoScroll property to true and set the ScrollableControl.AutoScrollMinSize property to the desired size. When the control is sized smaller than the specified minimum size, or a child control is located outside the bounds of the control, the appropriate scroll bars are displayed.

To manually override which scroll bars are visible, set the ScrollableControl.VScroll and ScrollableControl.HScroll properties. If either property is set to false, the corresponding scroll bar is not visible, even if the ScrollableControl.AutoScroll property is set to true.

You can handle the ScrollableControl.Scroll event to know when the user or code scrolls the client area.

When adding controls programmatically to a form, use the ScrollableControl.AutoScrollPosition property to position the control either inside or outside of the current viewable scroll area.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0