Export (0) Print
Expand All

ScrollableControl.SetAutoScrollMargin Method

Sets the size of the auto-scroll margins.

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

member SetAutoScrollMargin : 
        x:int * 
        y:int -> unit


Type: System.Int32

The Width value.

Type: System.Int32

The Height value.

The margin sets the width and height of the border around each control. This margin is used to determine when scroll bars are needed on the container and where to scroll to when a control is selected.


If a negative number is passed in as the x or y values, the value will be reset to 0.

The following code example uses the derived class, Panel. The example evaluates the location of a text box and changes the appearance and behavior of its parent container, the panel control. The example requires that you have created an instance of a Panel control, TextBox, and Button. Place the box on the panel so that it overlaps at least one of the panel's edges. Call this subprocedure on the click of a button to see the difference in the panel's behavior and appearance.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft