AutoScroll Property

Form.AutoScroll Property

 

Gets or sets a value indicating whether the form enables autoscrolling.

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

override AutoScroll : bool with get, set

Property Value

Type: System.Boolean

true to enable autoscrolling on the form; otherwise, false. The default is false.

If this property is set to true, scroll bars are displayed on the form if any controls are located outside the form's client region. Additionally, when autoscrolling is on, the client area of the form automatically scrolls to make the control with input focus visible.

You can use this property to prevent users from losing the ability to view controls when their video resolution settings are set to a low resolution.

The following code example demonstrates how to use the AutoScroll property to enable the display of controls that are outsize the client area of a form. The example creates a new form and adds a Button control to the form. The Button control is positioned outsize the client area of the new form. The AutoScroll property is set to true to display scroll bars on the form to enable the user to scroll to the control. This example requires that the method defined in this example is called from another form in an event handler or other method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft