Version

AutoScrollMargin Property

Gets or sets the margin used around child controls when AutoScroll is enabled.
Syntax
'Declaration
 
Public Property AutoScrollMargin As Size
public Size AutoScrollMargin {get; set;}
Example
The following code demonstartes how to control the automatic scrolling capability of the UltraPanel.

Imports System.Windows.Forms
Imports Infragistics.Win

' Allow the UltraPanel to automatically show scroll bars based on its contents.
Me.UltraPanel1.AutoScroll = True

' Set the size of the UltraPanel
Me.UltraPanel1.Size = New Size(300, 300)

' Set the auto scroll margin so that 20 pixels of space are between the right 
' and bottom edges of the child controls and the edges of the area the user can 
' scroll to.
Me.UltraPanel1.AutoScrollMargin = New Size(20, 20)

' If no child control exists or they are not positioned far enough, make sure
' the scrollable area of the UltraPanel is at least 100 pixels wide and 500 tall.
Me.UltraPanel1.AutoScrollMinSize = New Size(100, 500)

' Add a .Net Button control to the UltraPanel which extends to 350 pixels in the 
' X and Y directions, which will cause the UltraPanel to show both scroll bars.
Dim button As New Button()
button.Location = New Point(250, 250)
button.Size = New Size(100, 100)
Me.UltraPanel1.ClientArea.Controls.Add(Button)
using System.Windows.Forms;
using Infragistics.Win;

// Allow the UltraPanel to automatically show scroll bars based on its contents.
this.ultraPanel1.AutoScroll = true;

// Set the size of the UltraPanel
this.ultraPanel1.Size = new Size( 300, 300 );

// Set the auto scroll margin so that 20 pixels of space are between the right 
// and bottom edges of the child controls and the edges of the area the user can 
// scroll to.
this.ultraPanel1.AutoScrollMargin = new Size( 20, 20 );

// If no child control exists or they are not positioned far enough, make sure
// the scrollable area of the UltraPanel is at least 100 pixels wide and 500 tall.
this.ultraPanel1.AutoScrollMinSize = new Size( 100, 500 );

// Add a .Net Button control to the UltraPanel which extends to 350 pixels in the 
// X and Y directions, which will cause the UltraPanel to show both scroll bars.
Button button = new Button();
button.Location = new Point( 250, 250 );
button.Size = new Size( 100, 100 );
this.ultraPanel1.ClientArea.Controls.Add( button );
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also