This documentation is archived and is not being maintained.

ScrollableControl Class

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

For a list of all members of this type, see ScrollableControl Members.


[Visual Basic]
Public Class ScrollableControl
   Inherits Control
public class ScrollableControl : Control
public __gc class ScrollableControl : public Control
public class ScrollableControl extends Control

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


You do not typically use this class directly. The ContainerControl and Panel classes inherit from this class.

The ScrollableControl class acts as a base class for controls that require the ability to scroll. To allow a control to display scroll bars as needed, set the AutoScroll property to true and set the 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 VScroll and HScroll properties. If either property is set to false, the corresponding scroll bar will not be visible, even if the AutoScroll property is set to true.

When adding controls to a scrollable control the x-coordinate and y-coordinate of the AutoScrollPosition must be added to or subtracted as an offset from the corresponding coordinates of the Control.Location property of the control being added. To add a control above or to the left of the scroll position, the offset must be added to the desired location. Alternatively, to add a control below or to the right of the scroll position, the offset must be subtracted.


Namespace: System.Windows.Forms

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

See Also

ScrollableControl Members | System.Windows.Forms Namespace | Panel | ContainerControl