Class ScrollBarBase
Represents a base class that is used to draw the Horizontal and Vertical scrollbars of the SfScrollControl.
Namespace: Syncfusion.WinForms.Controls
Assembly: Syncfusion.Core.WinForms.dll
Syntax
public class ScrollBarBase : Control
Constructors
ScrollBarBase()
Initializes a new instance of the ScrollBarBase class.
Declaration
public ScrollBarBase()
ScrollBarBase(ScrollBars, ScrollBarStyleInfo)
Initializes a new instance of the ScrollBarBase class.
Declaration
public ScrollBarBase(ScrollBars type, ScrollBarStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollBars | type | The type of the scrollbar. |
ScrollBarStyleInfo | style | The |
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 |
EnableMaximumArrow
Gets or sets a value indicating whether maximum arrow can be enabled or not. Default value is true.
Declaration
public bool EnableMaximumArrow { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableMinimumArrow
Gets or sets a value indicating whether minimum arrow can be enabled or not. Default value is true.
Declaration
public bool EnableMinimumArrow { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableThumb
Gets or sets a value indicating whether the scroll bar thumb can be enabled or not. Default value is true.
Declaration
public bool EnableThumb { get; set; }
Property Value
Type |
---|
System.Boolean |
Font
Gets or sets the System.Drawing.Font value for the control.
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
LargeChange
Gets or sets a value to be added to or subtracted from the Value property when the scroll box is moved a large distance.
Declaration
public int LargeChange { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
When the user clicks the scroll bar, Maximum button or minimum button, the Value property changes according to the value set in the LargeChange property.
Maximum
Gets or sets the upper limit of values of the scrollable range.
Declaration
public int Maximum { get; set; }
Property Value
Type |
---|
System.Int32 |
Minimum
Gets or sets the lower limit of values of the scrollable range.
Declaration
public int Minimum { get; set; }
Property Value
Type |
---|
System.Int32 |
SmallChange
Gets or sets a value to be added or subtracted from the Value property when the scroll box is moved a small distance.
Declaration
public int SmallChange { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
When the user clicks the scroll bar, Maximum button or minimum button , the Value property changes according to the value set in the SmallChange property.
Style
Gets or sets the
Declaration
public ScrollBarStyleInfo Style { get; set; }
Property Value
Type |
---|
ScrollBarStyleInfo |
Value
Gets or sets a numeric value that represents the current position of the scroll box on the scroll bar control.
Declaration
public int Value { get; set; }
Property Value
Type |
---|
System.Int32 |
Methods
CalculateThumbDelta(Int32, Int32)
Used for calculating thumb offset.
Declaration
protected virtual void CalculateThumbDelta(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X co-ordinate. |
System.Int32 | y | The Y co-ordinate. |
CreateAccessibilityInstance()
Overridden to update the accessibility object of the SfScrollBar.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type | Description |
---|---|
System.Windows.Forms.AccessibleObject | Returns the accessibility object of the SfScrollBar. |
Dispose(Boolean)
Releases the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Specifies whether to dispose the managed and unmanaged resources or only the unmanaged resource. |
DrawArrow(Graphics, Rectangle, ScrollButton, ButtonState, ScrollBarStyleInfo)
Draws the arrow for the scrollbar button.
Declaration
protected virtual void DrawArrow(Graphics g, Rectangle rect, ScrollButton type, ButtonState state, ScrollBarStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics that used to draw the arrow.. |
System.Drawing.Rectangle | rect | The bounds of the arrow. |
System.Windows.Forms.ScrollButton | type | The scroll button type. |
System.Windows.Forms.ButtonState | state | The scroll button state. |
ScrollBarStyleInfo | style | The Style of the scrollbar. |
DrawScrollBarBackground(Graphics, Rectangle, ButtonState, ScrollBarStyleInfo)
Draws the background for the scrollbar.
Declaration
protected virtual void DrawScrollBarBackground(Graphics g, Rectangle bounds, ButtonState state, ScrollBarStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics object. |
System.Drawing.Rectangle | bounds | The bounds of the scrollbar. |
System.Windows.Forms.ButtonState | state | The state of the scrollbar. |
ScrollBarStyleInfo | style | The Style of the scrollbar. |
DrawThumbBackground(Graphics, Rectangle, ButtonState, ScrollBarStyleInfo)
Draws the background for the scrollbar Thumb.
Declaration
protected virtual void DrawThumbBackground(Graphics g, Rectangle rect, ButtonState state, ScrollBarStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Graphics object. |
System.Drawing.Rectangle | rect | The bounds of the scroll button. |
System.Windows.Forms.ButtonState | state | The state of the scroll button. |
ScrollBarStyleInfo | style | The Style of the scrollbar. |
GetMaxButton()
Gets max button.
Declaration
protected virtual ScrollButton GetMaxButton()
Returns
Type | Description |
---|---|
System.Windows.Forms.ScrollButton | Returns the max scroll button. |
GetMinButton()
Gets min button.
Declaration
protected virtual ScrollButton GetMinButton()
Returns
Type | Description |
---|---|
System.Windows.Forms.ScrollButton | Returns the min scroll button. |
GetStyle()
Gets the style of the ScrollBarStyleInfo.
Declaration
protected virtual ScrollBarStyleInfo GetStyle()
Returns
Type | Description |
---|---|
ScrollBarStyleInfo | Returns the ScrollBar style. |
InitializeContextMenu(ContextMenuStrip)
Initialize the context menu strip for the scrollbar.
Declaration
protected virtual void InitializeContextMenu(ContextMenuStrip contextMenuStrip)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ContextMenuStrip | contextMenuStrip | The context menu strip that need to be displayed. |
InvalidateArrowRegion()
Invalidates the bounds of the arrow buttons.
Declaration
protected virtual void InvalidateArrowRegion()
InvalidateScrollBar()
Recalculates the bounds of the scrollbar.
Declaration
protected virtual void InvalidateScrollBar()
InvalidateThumbRegion()
Invalidates the bounds of the thumb region.
Declaration
protected virtual void InvalidateThumbRegion()
IsRightToLeft()
Gets a value indicating whether RightToLeft mode is enabled or not for scrollbar.
Declaration
protected bool IsRightToLeft()
Returns
Type | Description |
---|---|
System.Boolean | Returns true when the RTL is enabled otherwise return false. |
OnLayout(LayoutEventArgs)
Recalculates the scrollbar regions when performs the layout.
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.LayoutEventArgs | e | The System.Windows.Forms.LayoutEventArgs that contains event data. |
OnMaximumClick(Object, EventArgs)
Raises the Scroll event when mouse click on maximum thumb region.
Declaration
protected virtual void OnMaximumClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnMinimumClick(Object, EventArgs)
Raises the Scroll event when the mouse click on minimum thumb region.
Declaration
protected virtual void OnMinimumClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnMouseDown(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseDown event.
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. |
OnMouseEnter(EventArgs)
Raises the System.Windows.Forms.Control.MouseEnter event.
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains event data. |
OnMouseLeave(EventArgs)
Raises the System.Windows.Forms.Control.MouseLeave event.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains event data. |
OnMouseMove(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseMove event.
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)
Performs the scrolling on the System.Windows.Forms.Control.MouseUp event.
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. |
OnPageDownRightClick(Object, EventArgs)
Raises the Scroll event mouse click on bottom right thumb region.
Declaration
protected virtual void OnPageDownRightClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnPageUpLeftClick(Object, EventArgs)
Raises the Scroll event when the mouse click on top left thumb region.
Declaration
protected virtual void OnPageUpLeftClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnPaint(PaintEventArgs)
Draws the Scrollbar components based on the Style value.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs that contains event data. |
OnRightToLeftChanged(EventArgs)
Redraws the scroll control when RightToLeft is changed.
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains event data. |
OnScroll(ScrollEventArgs)
Raise the Scroll event.
Declaration
protected virtual void OnScroll(ScrollEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollEventArgs | e | The System.Windows.Forms.ScrollEventArgs that contains event data. |
OnScrollDownRightClick(Object, EventArgs)
Raises the Scroll event when the mouse click on down left thumb region.
Declaration
protected virtual void OnScrollDownRightClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnScrollHereClick(Object, EventArgs)
Raises the mouse click on the scrollbar.
Declaration
protected virtual void OnScrollHereClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnScrollUpLeftClick(Object, EventArgs)
Raises Scroll event when the mouse click on top left thumb region.
Declaration
protected virtual void OnScrollUpLeftClick(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object of the sender |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnSizeChanged(EventArgs)
Raises the System.Windows.Forms.Control.SizeChanged event.
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains event data. |
OnThumbPositionChanged(Int32, Int32)
Occurs when the scrollbar thumb is dragged.
Declaration
protected virtual void OnThumbPositionChanged(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X co-ordinates. |
System.Int32 | y | The Y co-ordinates. |
OnValueChanged(EventArgs)
Raises the ValueChanged event.
Declaration
protected virtual void OnValueChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains event data. |
PointToValue(Int32, Int32)
Gets the value of the scrollbar at the given point.
Declaration
protected virtual int PointToValue(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X co-ordinate. |
System.Int32 | y | The Y co-ordinate. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the value of the scrollbar. |
Events
ContextMenuShowing
Occurs when the context menu is showing for the control.
Declaration
public event ContextMenuShowingEventHandler ContextMenuShowing
Event Type
Type |
---|
ContextMenuShowingEventHandler |
Scroll
Occurs when the scrolling is performed.
Declaration
public event ScrollEventHandler Scroll
Event Type
Type |
---|
System.Windows.Forms.ScrollEventHandler |
ValueChanged
Occurs when the Value property is changed.
Declaration
public event EventHandler ValueChanged
Event Type
Type |
---|
System.EventHandler |