Class SfScrollControl
Represents a base class for the controls that supports scrolling.
Inherited Members
Namespace: Syncfusion.WinForms.Controls
Assembly: Syncfusion.Core.WinForms.dll
Syntax
public class SfScrollControl : BaseControl, IThemeProvider, IVisualStyle, IDisposable, ISupportUpdate
Constructors
SfScrollControl()
Initializes a new instance of the SfScrollControl class.
Declaration
public SfScrollControl()
Properties
AccessibilityEnabled
Gets or sets a value indicating whether the accessibility is enabled for the control or not.
Declaration
public bool AccessibilityEnabled { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowAutoScroll
Gets or sets a value indicating whether the AutoScrolling can be enabled.
Declaration
protected bool AllowAutoScroll { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowReaderModeScrolling
Gets or sets a value indicating whether the reader mode mouse scrolling is enabled or not.
Declaration
public bool AllowReaderModeScrolling { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Reader mode shows a special scroll origin icon and scrolls the window in a direction and speed relative to the scroll origin.
AutoScrollBounds
Gets or sets a bounds for the auto scrolling.
Declaration
public Rectangle AutoScrollBounds { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
AutoScrollInterval
Gets or sets a System.TimeSpan value for the auto scrolling.
Declaration
public TimeSpan AutoScrollInterval { get; set; }
Property Value
| Type |
|---|
| System.TimeSpan |
AutoScrollMargin
Gets or sets a default margins for the scrolling area when the user moves the mouse to the margin between InsideScrollBounds and AutoScrollBounds.
Declaration
public Size AutoScrollMargin { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
AutoScrollMode
Gets or sets the direction for automatic scrolling when the user drags the mouse cursor out of the scrolling area.
Declaration
public AutoScrollOrientation AutoScrollMode { get; set; }
Property Value
| Type |
|---|
| AutoScrollOrientation |
ClientRectangle
Gets the rectangle that represents the client area of the control.
Declaration
public Rectangle ClientRectangle { get; }
Property Value
| Type |
|---|
| System.Drawing.Rectangle |
ClientSize
Gets or sets the ClientSize of the control based on the visibility of the scrollbars.
Declaration
public Size ClientSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
CreateParams
Changes System.Windows.Forms.CreateParams.Style RTL extended styles and also consider the control's
Declaration
protected override CreateParams CreateParams { get; }
Property Value
| Type |
|---|
| System.Windows.Forms.CreateParams |
HorizontalScroll
Gets the horizontal scrollbar settings of the control.
Declaration
public ScrollProperties HorizontalScroll { get; }
Property Value
| Type |
|---|
| ScrollProperties |
HorizontalScrollBarVisible
Gets or sets a value indicating whether the horizontal scroll bar is visible or not.
Declaration
public bool HorizontalScrollBarVisible { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
HorizontalScrollIncrement
Gets or sets the multiplier for horizontal mouse wheel scrolling.
Declaration
public virtual int HorizontalScrollIncrement { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
IsUpdating
Gets a value indicating whether the BeginUpdate() has been called and the painting for a control is suspended.
Declaration
public bool IsUpdating { get; }
Property Value
| Type |
|---|
| System.Boolean |
Style
Gets or sets a style of the ScrollControl components.
Declaration
public ScrollerVisualStyle Style { get; set; }
Property Value
| Type |
|---|
| ScrollerVisualStyle |
VerticalScroll
Gets the vertical scrollbar settings of the control.
Declaration
public ScrollProperties VerticalScroll { get; }
Property Value
| Type |
|---|
| ScrollProperties |
VerticalScrollBarVisible
Gets or sets a value indicating whether the vertical scroll bar is visible or not.
Declaration
public bool VerticalScrollBarVisible { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
VerticalScrollIncrement
Gets or sets the multiplier for vertical mouse wheel scrolling.
Declaration
public virtual int VerticalScrollIncrement { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
BeginUpdate()
Suspends the painting of the control until the EndUpdate() method is called.
Declaration
public void BeginUpdate()
CreateAccessibilityInstance()
Overridden to update the Accessibility object of the SfScrollControl.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
| Type | Description |
|---|---|
| System.Windows.Forms.AccessibleObject | Returns the accessibility object of the SfScrollControl |
Dispose(Boolean)
Disposes the unused resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | Specifies whether to dispose both managed and unmanaged resources or only the unmanaged resources. |
EndUpdate()
Resumes the painting of the control suspended by calling the BeginUpdate method.
Declaration
public void EndUpdate()
GetControlName(String)
Helps to apply the ControlName settings in control
Declaration
public override string GetControlName(string controlName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | controlName | The ControlName. |
Returns
| Type | Description |
|---|---|
| System.String | Returns the control name. |
Overrides
OnBeginAutoScroll(BeginAutoScrollEventArgs)
Raises the BeginAutoScroll event.
Declaration
protected virtual void OnBeginAutoScroll(BeginAutoScrollEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| BeginAutoScrollEventArgs | e | The BeginAutoScrollEventArgs that contains the event data. |
OnControlAdded(ControlEventArgs)
Wires the Control.GotFocus and Control.LostFocus events of the added control.
Declaration
protected override void OnControlAdded(ControlEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.ControlEventArgs | e | The System.Windows.Forms.ControlEventArgs that contains event data. |
OnControlGotFocus()
Raises the System.Windows.Forms.Control.GotFocus event. This method is called when the control or any child control gets focus and this control did not have focus before.
Declaration
protected virtual void OnControlGotFocus()
OnControlLostFocus()
Raises the System.Windows.Forms.Control.LostFocus event. This method is called when the control or any child control loses focus and the new focused control is not a child of this control.
Declaration
protected virtual void OnControlLostFocus()
OnControlRemoved(ControlEventArgs)
Occurs when the control is removed from the System.WindowsForms.Control.ControlCollection.
Declaration
protected override void OnControlRemoved(ControlEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.ControlEventArgs | e | The System.Windows.Forms.ControlEventArgs that contains event data. |
OnDragOver(DragEventArgs)
Starts the auto scrolling timer when the mouse is dragging over the control.
Declaration
protected override void OnDragOver(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.DragEventArgs | e | The System.Windows.Forms.DragEventArgs that contains event data. |
OnEndAutoScroll(EventArgs)
Raises the EndAutoScroll event.
Declaration
protected virtual void OnEndAutoScroll(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnEnter(EventArgs)
Occurs when the control is entered.
Declaration
protected override void OnEnter(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnGotFocus(EventArgs)
Occurs when the control receives focus.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnHandleCreated(EventArgs)
Wire the parent forms event when the System.Windows.Forms.Control.HandleCreated.
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnHorizontalScroll(ScrollEventArgs)
Raises the Scroll event for horizontal scroll.
Declaration
protected virtual void OnHorizontalScroll(ScrollEventArgs se)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.ScrollEventArgs | se | The System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnHorizontalScrollBarValueChanged()
Occurs when the horizontal scrollbar value is changed.
Declaration
protected virtual void OnHorizontalScrollBarValueChanged()
OnInvalidated(InvalidateEventArgs)
Occurs when the control's display required redraw.
Declaration
protected override void OnInvalidated(InvalidateEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.InvalidateEventArgs | e | An System.Windows.Forms.InvalidateEventArgs that contains the event data. |
OnLeave(EventArgs)
Occurs when the input focus leaves the control.
Declaration
protected override void OnLeave(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnLocationChanged(EventArgs)
Updates the scrollbar locations when the System.Windows.Forms.Control.Location property is changed.
Declaration
protected override void OnLocationChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnLostFocus(EventArgs)
Occurs when the control loses focus.
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnMouseDown(MouseEventArgs)
Occurs when the mouse pointer is over the control and the mouse button is pressed.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs that contains event data. |
OnMouseHover(EventArgs)
Stops the auto scroll timer when the mouse pointer is moves over the control.
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnMouseLeave(EventArgs)
Sets the default cursor when the mouse pointer leaves the control.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnMouseMove(MouseEventArgs)
Starts the auto scrolling when the mouse pointer is moved away from the scroll bounds.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs that contains event data. |
OnMouseUp(MouseEventArgs)
Occurs when mouse up is performed on the control.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs that contains event data. |
OnMouseWheel(MouseEventArgs)
Performs the mouse wheel scrolling when the System.Windows.Forms.Control.MouseWheel event is occur.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseEventArgs that contains event data. |
OnParentChanged(EventArgs)
Updates the parent form of the control.
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnRightToLeftChanged(EventArgs)
Occurs on Changing the RTL mode of the control.
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnSetCursor(ref Message)
Sets the current mouse cursor.
Declaration
protected virtual void OnSetCursor(ref Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m | The Window message. |
OnSizeChanged(EventArgs)
Updates the scrollbar locations when the System.Windows.Forms.Control.Size property value is changed.
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | themeName | The ThemeName. |
Overrides
OnTouchPan(Point, Boolean)
Adjust the horizontal and vertical scrollbar values based on current touch position.
Declaration
protected virtual bool OnTouchPan(Point currentTouchPoint, bool isSwipeScroll)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | currentTouchPoint | The current touch position. |
| System.Boolean | isSwipeScroll | Used to decide whether to perform swipe or pan operation. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true. |
OnTouchPanBegin(Point)
Initially save the current scrollbar values when begin the panning operation.
Declaration
protected virtual bool OnTouchPanBegin(Point touchBeginPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | touchBeginPoint | Touch begin position. |
Returns
| Type | Description |
|---|---|
| System.Boolean | return true |
OnTouchPanEnd(Point)
After panning operation completes save the current scroll bar values.
Declaration
protected virtual bool OnTouchPanEnd(Point touchEndPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | touchEndPoint | The touch end position. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Return true. |
OnValidated(EventArgs)
Occurs when the control finished the validating.
Declaration
protected override void OnValidated(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnValidating(CancelEventArgs)
Occurs while invalidating is called for the control.
Declaration
protected override void OnValidating(CancelEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.CancelEventArgs | e | The System.ComponentModel.CancelEventArgs that contains event data. |
OnVerticalScroll(ScrollEventArgs)
Raises the Scroll event for vertical scroll.
Declaration
protected virtual void OnVerticalScroll(ScrollEventArgs se)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.ScrollEventArgs | se | The System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnVerticalScrollBarValueChanged()
Occurs when the vertical scrollbar value is changed.
Declaration
protected virtual void OnVerticalScrollBarValueChanged()
OnVisibleChanged(EventArgs)
Update the scrollbars when the System.Windows.Forms.Control.VisibleChanged event is occured.
Declaration
protected override void OnVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains event data. |
OnWindowScrolled(ScrollWindowEventArgs)
Raises the WindowScrolled event.
Declaration
protected virtual void OnWindowScrolled(ScrollWindowEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ScrollWindowEventArgs | e | A ScrollWindowEventArgs that contains the event data. |
OnWindowScrolling(ScrollWindowEventArgs)
Raises the WindowScrolling event.
Declaration
protected virtual void OnWindowScrolling(ScrollWindowEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ScrollWindowEventArgs | e | The ScrollWindowEventArgs that contains the event data. |
RaiseThemeChanged(Object, ThemeChangedEventArgs)
Raises the ThemeNameChanged and ThemeChanged event when theme name changed.
Declaration
protected override void RaiseThemeChanged(object sender, ThemeChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The sender value. |
| ThemeChangedEventArgs | args | A ThemeChangedEventArgs contains the event data. |
Overrides
ScrollWindow(Int32, Int32, Rectangle, Rectangle, Boolean)
Scrolls the contents of the control based on the given values.
Declaration
public virtual Rectangle ScrollWindow(int xAmount, int yAmount, Rectangle rect, Rectangle clipRect, bool allowUpdate)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | xAmount | The x amount that need to be scrolled. |
| System.Int32 | yAmount | The y amount that need to be scrolled on vertical direction. |
| System.Drawing.Rectangle | rect | The bounds that need to be scrolled. |
| System.Drawing.Rectangle | clipRect | The ClipRectangle. |
| System.Boolean | allowUpdate | Specifies the value for update the window after the scrolling or not. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Rectangle | Returns the rectangle region that is scrolled. |
ScrollWindowInvalidate(Rectangle)
Invalidates the Scroll window.
Declaration
protected virtual void ScrollWindowInvalidate(Rectangle r)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | r | The Rectangle region that need to be invalidate. |
StartAutoScrollTimer(Message)
Starts the AutoScroll timer.
Declaration
protected void StartAutoScrollTimer(Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m | The message to be sent to the current control. |
StartAutoScrollTimer(Message, TimeSpan)
Starts the AutoScroll timer.
Declaration
protected void StartAutoScrollTimer(Message m, TimeSpan autoScrollInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m | The message to be sent to the current control. |
| System.TimeSpan | autoScrollInterval | The initial interval for sending messages. |
UpdateScrollBars()
Synchronize the scrollbar regions to reflect the changes.
Declaration
public virtual void UpdateScrollBars()
WndProc(ref Message)
Overrides the WndProc method.
Declaration
protected override void WndProc(ref Message msg)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | msg | An Window message. |
Remarks
To handle the window messages internally for the Touch, ContextMenu and painting operations.
Events
BeginAutoScroll
Occurs when accelerated scrollbar scrolling or mouse drag-scrolling starts.
Declaration
public event BeginAutoScrollEventHandler BeginAutoScroll
Event Type
| Type |
|---|
| BeginAutoScrollEventHandler |
EndAutoScroll
Occurs when the auto scrolling is ends.
Declaration
public event EventHandler EndAutoScroll
Event Type
| Type |
|---|
| System.EventHandler |
Scroll
Occurs when scrolling is performed.
Declaration
public event ScrollEventHandler Scroll
Event Type
| Type |
|---|
| System.Windows.Forms.ScrollEventHandler |
ThemeChanged
Occurs when theme name of the SfScrollControl has changed.
Declaration
public event ThemeChangedEventHandler ThemeChanged
Event Type
| Type |
|---|
| ThemeChangedEventHandler |
WindowScrolled
Occurs after the window has been scrolled.
Declaration
public event ScrollWindowEventHandler WindowScrolled
Event Type
| Type |
|---|
| ScrollWindowEventHandler |
WindowScrolling
Occurs while the window is being scrolled.
Declaration
public event ScrollWindowEventHandler WindowScrolling
Event Type
| Type |
|---|
| ScrollWindowEventHandler |