System.Windows.Forms
1.0.5000.0
2.0.0.0
System.Windows.Forms.Control
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")
You do not typically use the class directly. The and classes inherit from this class.
The 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 property to true and set the 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 and properties. If either property is set to false, the corresponding scroll bar is not visible, even if the property is set to true.
You can handle the event to know when the user or code scrolls the client area.
When adding controls programmatically to a form, use the property to position the control either inside or outside of the current viewable scroll area.
Defines a base class for controls that support auto-scrolling behavior.
Constructor
The default constructor performs the following actions:
-
Marks the current instance as a container control by calling the method to set the style to true.
-
Enables background erasing by setting the to false.
-
Disables auto-scrolling by calling the method to set the bit to false.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Method
System.Void
When required, the method lays out the client area, including resizing the display area as required to accommodate the scroll bars.
Adjusts the scroll bars on the container based on the current control positions and the control currently selected.
true to show the scroll bars; otherwise, false.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Property
System.ComponentModel.Localizable(true)
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
When true, this property enables the container to have a virtual size that is larger than its visible boundaries.
There is currently a limitation in Windows Forms that prevents all classes derived from from acting properly when both is enabled and is set to . For example, let's say that you place a control such as —or a container class derived from (such as or )—on your form. If you set on the container to and then set the property on one or more of the controls inside of the container to , then no scrollbar ever appears. The class derived from acts as if were set to .
Currently, the only workaround is to nest the inside another . For instance, if you need to work in this situation, you can place it inside of a control and set on the to .
maintains the visibility of the scrollbars automatically. Therefore, setting the or property to true has no effect when is enabled.
Gets or sets a value indicating whether the container enables the user to scroll to any controls placed outside of its visible boundaries.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.Localizable(true)
System.Drawing.Size
To be added.
The auto-scroll margin is the distance between any child controls and the edges of the scrollable parent control. The size is added to the size of any child controls contained in the scrollable control to determine whether or not scroll bars are needed. The property is evaluated when the parent scrollable control is resized or the individual child controls are brought into view, and is used to determine if scroll bars must be displayed. Docked controls are excluded from the calculations that determine if scroll bars must be displayed.
If a docked control's property is set to , the control fills the parent scrollable control and the docked control is ignored when using the to determine whether scroll bars are needed.
If the distance from the edge of a child control to the parent scrollable control is less than the value assigned to the property and the property is set to true, the appropriate scroll bar is displayed.
We recommend, when docking controls within a scrollable control, that you add a child scrollable control, such as a , to contain any other controls that might require scrolling. You should add the child control to the scrollable control and its property set to and its property set to true. You should set the property of the parent scrollable control to false.
Gets or sets the size of the auto-scroll margin.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.Localizable(true)
System.Drawing.Size
To be added.
The property is used to manage the screen size allocated to the automatic scroll bars.
Gets or sets the minimum size of the auto-scroll.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Drawing.Point
To be added.
The property represents the location of the visible portion of a scrollable control. Use this property to change the portion of the control that is displayed.
When adding controls programmatically to a form, use the property to position the control either inside or outside of the current viewable scroll area.
The and coordinate values retrieved are negative if the control has scrolled away from its starting position (0,0). When you set this property, you must always assign positive and values to set the scroll position relative to the starting position. For example, if you have a horizontal scroll bar and you set x and y to 200, you move the scroll 200 pixels to the right; if you then set x and y to 100, the scroll appears to jump the left by 100 pixels, because you are setting it 100 pixels away from the starting position. In the first case, returns {-200, 0}; in the second case, it returns {-100,0}.
To detect when changes, create an event handler for the event, save the old position value in a private variable, and compare the new value to the old value on subsequent events.
Gets or sets the location of the auto-scroll position.
1.0.5000.0
2.0.0.0
Property
System.Windows.Forms.CreateParams
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
Property
System.Drawing.Rectangle
To be added.
If the property is set to true, the property is the virtual size and position of the control. For example, if the width and height of the are both 100 pixels and the control contains controls that extend beyond its boundaries, represents the size the needs to be to include the contained controls. Similarly, the and properties of are relevant to the scroll position of the .
Gets the rectangle that represents the virtual display area of the control.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.Windows.Forms.ScrollableControl+DockPaddingEdges
To be added.
This property controls the border inside of this control for docked components.
Gets the dock padding settings for all edges of the control.
1.0.5000.0
2.0.0.0
Method
System.Boolean
The following table describes the flags the control uses.
-
Value
Description
-
A mask used to retrieve whether the property is set to true.
-
A mask used to retrieve whether the property is set to true.
-
A mask used to retrieve whether the property is set to true.
-
A mask used to retrieve whether the user has made the scroll.
-
A mask used to retrieve whether the user has enabled the full window drag-and-drop operation.
Determines whether the specified flag has been set.
true if the specified flag has been set; otherwise, false.
The flag to check.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Property
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)
System.ComponentModel.Browsable(false)
System.Windows.Forms.HScrollProperties
To be added.
The class contains information about the scroll bar and its operation, such as whether it is enabled and visible, the scroll page size, orientation, display position, and so on.
Gets the characteristics associated with the horizontal scroll bar.
Property
System.Boolean
To be added.
The functionality of the property can also be accomplished through calls to the and methods using as the parameter.
Note maintains the visibility of the scrollbars automatically. Therefore, setting the or properties to true have no effect when is enabled.
Gets or sets a value indicating whether the horizontal scroll bar is visible.
1.0.5000.0
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Method
System.Void
If the vertical scroll bar is visible, which means that the property is set to true, the mouse wheel scrolls through the control vertically. However, if only the horizontal scroll bar is visible, which means that the is set to false and the property to set to true, the mouse wheel scrolls horizontally.
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Method
2.0.0.0
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
An that contains the event data.
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Paints the background of the control.
A that contains the event data.
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
Method
2.0.0.0
System.Void
To be added.
To be added.
To be added.
To be added.
Method
System.Void
To be added.
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
Event
2.0.0.0
System.Windows.Forms.ScrollEventHandler
The event occurs when the user scrolls through the client area by interacting with the scroll bars, or when the user navigates between controls and the active control scrolls into view. The event also occurs when you write code, such as setting the property, that scrolls through the client area.
You can use the property in your event handler to determine the scroll bar orientation for the event.
For more information about handling events, see Consuming Events.
Occurs when the user or code scrolls through the client area.
Method
System.Void
The property must be set to true, and at least one of the scroll bars, horizontal or vertical, must also be visible, for the method to have an effect. To make the horizontal and vertical scroll bars visible, the and properties, respectively, must be set to true.
If the parameter is not a child control, no action takes place.
This method may raise the event.
Scrolls the specified child control into view on an auto-scroll enabled control.
The child control to scroll into view.
1.0.5000.0
2.0.0.0
Field
System.Int32
1
The field is a mask. You can use it with the and methods to get and set the property.
Determines the value of the property.
1.0.5000.0
2.0.0.0
Field
System.Int32
16
The field is a mask. Use it with the and methods to get and set whether the user has enabled full window drag.
When full window drag is enabled, the contents of windows are displayed when the user moves and sizes the windows.
Determines whether the user has enabled full window drag.
1.0.5000.0
2.0.0.0
Field
System.Int32
2
The field is a mask. Use it with the and methods to get and set the property.
Determines whether the value of the property is set to true.
1.0.5000.0
2.0.0.0
Field
System.Int32
8
The field is a mask. Use it with the method to get whether the user had scrolled through the .
Determines whether the user had scrolled through the control.
1.0.5000.0
2.0.0.0
Field
System.Int32
4
The field is a mask. Use it with the and methods to get and set the property.
Determines whether the value of the property is set to true.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Drawing.Point
The method uses the method to calculate how far it must scroll to display the specified control. The property of the child control is used to adjust the scrolled position.
does not cause scrolling; the method is typically used to subsequently scroll to the calculated position.
Calculates the scroll offset to the specified child control.
The upper-left hand of the display area relative to the client area required to scroll the control into view.
The child control to scroll into view.
Method
System.Void
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 or values, the value will be reset to 0.
Sets the size of the auto-scroll margins.
The value.
The value.
1.0.5000.0
2.0.0.0
Method
System.Void
If the property is set to true, the property is the virtual size and position displayed client area of the . Call the method to scroll through the to the specified position.
Positions the display window to the specified value.
The horizontal offset at which to position the .
The vertical offset at which to position the .
1.0.5000.0
2.0.0.0
Method
System.Void
When the bit parameter is set to one of the fields of the class, the method updates the state of the control to the parameter. For more information about the valid parameters and their values, see the method.
Sets the specified scroll state flag.
The scroll state flag to set.
The value to set the flag.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)
System.ComponentModel.Browsable(false)
System.Windows.Forms.VScrollProperties
To be added.
The class contains information about the scroll bar and its operation, such as whether it is enabled and visible, the scroll page size, orientation, display position, and so on.
Gets the characteristics associated with the vertical scroll bar.
Property
System.Boolean
To be added.
The functionality of the property can also be accomplished through calls to the and methods using as the parameter.
Note maintains the visibility of the scrollbars automatically. Therefore, setting the or properties to true have no effect when is enabled.
Gets or sets a value indicating whether the vertical scroll bar is visible.
1.0.5000.0
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)