menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ScrollBarCustomDraw - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ScrollBarCustomDraw

    Base class for scrollers control that support visual styles.

    Inheritance
    System.Object
    ScrollBarCustomDraw
    HScrollBarCustomDraw
    VScrollBarCustomDraw
    Namespace: Syncfusion.Windows.Forms
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class ScrollBarCustomDraw : ContainerControl

    Constructors

    ScrollBarCustomDraw()

    Initializes a new instance of the ScrollBarCustomDraw class.

    Declaration
    public ScrollBarCustomDraw()

    Fields

    m_cachedLargeChange

    Cached m_largeChange

    Declaration
    protected int m_cachedLargeChange
    Field Value
    Type
    System.Int32

    m_IsSetControlsVisiblity

    To prevent validation controls visibility in and in .

    Declaration
    protected bool m_IsSetControlsVisiblity
    Field Value
    Type
    System.Boolean

    m_largeChange

    A value to be added to or subtracted from the System.Windows.Forms.ScrollBar.Value property when the scroll box is moved a large distance.

    Declaration
    protected int m_largeChange
    Field Value
    Type
    System.Int32

    m_lastPressedPoint

    Position where was last click.

    Declaration
    protected Point m_lastPressedPoint
    Field Value
    Type
    System.Drawing.Point

    m_max

    The upper limit of values of the scrollable range.

    Declaration
    protected int m_max
    Field Value
    Type
    System.Int32

    m_MenuProvider

    Instance of ContextMenu provider.

    Declaration
    protected IContextMenuProvider m_MenuProvider
    Field Value
    Type
    IContextMenuProvider

    m_min

    The lower limit of values of the scrollable range.

    Declaration
    protected int m_min
    Field Value
    Type
    System.Int32

    m_ptLocation

    To avoid compile error CS0197 in VS2002.

    Declaration
    protected Point m_ptLocation
    Field Value
    Type
    System.Drawing.Point

    m_rects

    Array of rectangles that represents regions of the ScrollBarCustomDraw.

    Declaration
    protected Rectangle[] m_rects
    Field Value
    Type
    System.Drawing.Rectangle[]

    m_smallChange

    A value to be added to or subtracted from the Syncfusion.Windows.Forms.ScrollBarCustomDraw.Value property when the scroll box is moved a small distance.

    Declaration
    protected int m_smallChange
    Field Value
    Type
    System.Int32

    m_value

    A numeric value that represents the current position of the scroll box on the scroll bar control.

    Declaration
    protected int m_value
    Field Value
    Type
    System.Int32

    Properties

    AttachedToListView

    Declaration
    protected bool AttachedToListView { get; }
    Property Value
    Type
    System.Boolean

    ContextMenuProvider

    Gets / sets the menu provider object that will implement the ScrollBarCustomDraw's contextmenu.

    Declaration
    public IContextMenuProvider ContextMenuProvider { get; set; }
    Property Value
    Type Description
    IContextMenuProvider

    A IContextMenuProvider implementation; the default is StandardMenusProvider.

    Remarks

    The ScrollBarCustomDraw control automatically initializes this property depending on the presence of the Syncfusion Essential Tools library. If Essential Tools is available, then the menu provider object will be an instance of the ContextMenuProvider type. If not, the StandardMenusProvider class is used for implementing the standard .NET context menu.

    The ScrollersFrame's automatic initialization should suffice for most applications and you should explicitly set this property only when you want to override the default menu provider assignment.

    Controls

    Hide Controls collection from CodeDom serialization.

    Declaration
    public Control.ControlCollection Controls { get; }
    Property Value
    Type
    System.Windows.Forms.Control.ControlCollection

    ControlsAfter

    Collection of controls that locates under the maximum arrow.

    Declaration
    public ControlsCollection ControlsAfter { get; }
    Property Value
    Type
    ControlsCollection

    ControlsBefore

    Collection of controls that locates above the minimum arrow.

    Declaration
    public ControlsCollection ControlsBefore { get; }
    Property Value
    Type
    ControlsCollection

    DisableMaximumArrow

    Gets or sets a value that indicates whether maximum arrow is disabled.

    Declaration
    public bool DisableMaximumArrow { get; set; }
    Property Value
    Type
    System.Boolean

    DisableMinimumArrow

    Gets or sets a value that indicates whether minimum arrow is disabled.

    Declaration
    public bool DisableMinimumArrow { get; set; }
    Property Value
    Type
    System.Boolean

    DisableThumb

    Gets or sets a value that indicates whether thumb is disabled.

    Declaration
    public bool DisableThumb { get; set; }
    Property Value
    Type
    System.Boolean

    IsRtl

    Returns the value that indicates whether RightToLeft is RightToLeft.Yes

    Declaration
    protected bool IsRtl { get; }
    Property Value
    Type
    System.Boolean

    KeepSystemMetrics

    True - say control to keep System settings instead of user defined, otherwise False.

    Declaration
    public bool KeepSystemMetrics { get; set; }
    Property Value
    Type
    System.Boolean

    LargeChange

    Gets or sets a value to be added to or subtracted from the System.Windows.Forms.ScrollBar.Value property when the scroll box is moved a large distance.

    Declaration
    public int LargeChange { get; set; }
    Property Value
    Type
    System.Int32

    Maximum

    Gets or sets the upper limit of values of the scrollable range.

    Declaration
    public int Maximum { get; set; }
    Property Value
    Type
    System.Int32

    MetroColorScheme

    Gets or sets whether the Metro color scheme should be user defined color.

    Declaration
    public MetroColorScheme MetroColorScheme { get; set; }
    Property Value
    Type
    MetroColorScheme

    MetroColorTable

    Gets or sets the metro color table.

    Declaration
    public MetroColorTable MetroColorTable { get; set; }
    Property Value
    Type
    MetroColorTable

    Minimum

    Gets or sets the lower limit of values of the scrollable range.

    Declaration
    public int Minimum { get; set; }
    Property Value
    Type
    System.Int32

    Office2010ColorScheme

    Gets or sets whether the Office2010 color scheme should be Silver or Blue or Black.

    Declaration
    public Office2010ColorScheme Office2010ColorScheme { get; set; }
    Property Value
    Type
    Office2010ColorScheme

    Office2016BlackColorTable

    Gets or sets the color table for Office2016 Black theme scrollbar.

    Declaration
    public MetroColorTable Office2016BlackColorTable { get; set; }
    Property Value
    Type
    MetroColorTable

    Office2016ColorfulColorTable

    Gets or sets the color table for Office2016 colorful theme scrollbar.

    Declaration
    public MetroColorTable Office2016ColorfulColorTable { get; set; }
    Property Value
    Type
    MetroColorTable

    Office2016ColorScheme

    Gets or sets whether the Office2016 color scheme should be Black or White or DarkGray or Colorful.

    Declaration
    public ScrollBarOffice2016ColorScheme Office2016ColorScheme { get; set; }
    Property Value
    Type
    ScrollBarOffice2016ColorScheme
    Remarks

    This is applicable for both the horizontal and vertical scrollbar.

    Office2016DarkGrayColorTable

    Gets or sets the color table for Office2016 dark gray theme scrollbar.

    Declaration
    public MetroColorTable Office2016DarkGrayColorTable { get; set; }
    Property Value
    Type
    MetroColorTable

    Office2016WhiteColorTable

    Gets or sets the color table for Office2016 white theme scrollbar.

    Declaration
    public MetroColorTable Office2016WhiteColorTable { get; set; }
    Property Value
    Type
    MetroColorTable

    OfficeColorScheme

    Gets or sets whether the Office color scheme should be Silver or Blue or Black.

    Declaration
    public Office2007ColorScheme OfficeColorScheme { get; set; }
    Property Value
    Type
    Office2007ColorScheme

    RefreshOnValueChange

    Gets or sets value indicating whether scrollbar should be refreshed on each value change. If set to false, scrollbar is invalidated only and therefore is visually refreshed after processing all scrolling messages.

    Declaration
    public bool RefreshOnValueChange { get; set; }
    Property Value
    Type
    System.Boolean

    SmallChange

    Gets or sets a value to be added to or subtracted from the Syncfusion.Windows.Forms.ScrollBarCustomDraw.Value property when the scroll box is moved a small distance.

    Declaration
    public int SmallChange { get; set; }
    Property Value
    Type
    System.Int32

    Text

    Gets or sets the text associated with this control.

    Declaration
    public override string Text { get; set; }
    Property Value
    Type
    System.String

    ThemeEnabled

    Gets or sets a value that indicates whether to use visual styles.

    Declaration
    public bool ThemeEnabled { get; set; }
    Property Value
    Type
    System.Boolean

    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

    VisualStyle

    Visual style of the ScrollBarCustomDraw.

    Declaration
    public ScrollBarCustomDrawStyles VisualStyle { get; set; }
    Property Value
    Type
    ScrollBarCustomDrawStyles

    Methods

    Accumulate(ControlsCollection)

    Method accumulate width and height of the controls in specified collection.

    Declaration
    protected Size Accumulate(ControlsCollection collection)
    Parameters
    Type Name Description
    ControlsCollection collection

    collection of controls.

    Returns
    Type Description
    System.Drawing.Size

    Accumulated values.

    CalculatedDelta(Int32, Int32)

    used for calculates thumb offset.

    Declaration
    protected virtual void CalculatedDelta(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x
    System.Int32 y

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    DropHandle()

    Utility API that open to user opportunity to destroy handle in runtime. Very usefull for runtime resource cleanup.

    Declaration
    public void DropHandle()

    GetAfterControlsDockStyle()

    Gets DockStyle of afterControls.

    Declaration
    protected virtual DockStyle GetAfterControlsDockStyle()
    Returns
    Type
    System.Windows.Forms.DockStyle

    GetBeforeControlsDockStyle()

    Gets DockStyle of beforeControls.

    Declaration
    protected virtual DockStyle GetBeforeControlsDockStyle()
    Returns
    Type
    System.Windows.Forms.DockStyle

    GetMaxButton()

    Gets max button. Possible variants: Right or Up.

    Declaration
    protected virtual ScrollButton GetMaxButton()
    Returns
    Type
    System.Windows.Forms.ScrollButton

    GetMinButton()

    Gets min button. Possible variants: Left or Down.

    Declaration
    protected virtual ScrollButton GetMinButton()
    Returns
    Type
    System.Windows.Forms.ScrollButton

    HitTest(Int32, Int32)

    Defines pressed zone.

    Declaration
    protected virtual PressedZone HitTest(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x
    System.Int32 y
    Returns
    Type
    PressedZone

    IsControlsVisible()

    If scroll contain all controls than controls is visible, in other case value is false.

    Declaration
    protected virtual bool IsControlsVisible()
    Returns
    Type
    System.Boolean

    Layout()

    Forces the laying out of combobox elements.

    Declaration
    public virtual void Layout()
    Remarks

    Advanced method. You do not have to call this directly.

    OnAfterControlConfigure(Object, ConfigureControlEventArgs)

    Declaration
    protected virtual void OnAfterControlConfigure(object sender, ConfigureControlEventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    ConfigureControlEventArgs e

    OnAfterControlConfigure(Control)

    Declaration
    protected virtual void OnAfterControlConfigure(Control control)
    Parameters
    Type Name Description
    System.Windows.Forms.Control control

    OnBeforeControlConfigure(Object, ConfigureControlEventArgs)

    Declaration
    protected virtual void OnBeforeControlConfigure(object sender, ConfigureControlEventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    ConfigureControlEventArgs e

    OnBeforeControlConfigure(Control)

    Declaration
    protected virtual void OnBeforeControlConfigure(Control control)
    Parameters
    Type Name Description
    System.Windows.Forms.Control control

    OnControlAdded(ControlEventArgs)

    If outside code will work with Controls collection instead of our collections ControlsBefore and ControlsAfter, then this method will help us in synchronization.

    Declaration
    protected override void OnControlAdded(ControlEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.ControlEventArgs e

    OnControlRemoved(ControlEventArgs)

    If outside code will work with Controls collection instead of our collections ControlsBefore and ControlsAfter, then this method will help us in synchronization.

    Declaration
    protected override void OnControlRemoved(ControlEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.ControlEventArgs e

    OnLargeChangeChanged(EventArgs)

    Raises the OnLargeChangeChanged event.

    Declaration
    protected virtual void OnLargeChangeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnLayout(LayoutEventArgs)

    Override. Force recalculation of Scroller elements.

    Declaration
    protected override void OnLayout(LayoutEventArgs levent)
    Parameters
    Type Name Description
    System.Windows.Forms.LayoutEventArgs levent

    Layout arguments.

    Remarks

    To force Layout logic call .

    OnMaximumChanged(EventArgs)

    Raises the OnMaximumChanged event.

    Declaration
    protected virtual void OnMaximumChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnMaximumClick(Object, EventArgs)

    Declaration
    protected virtual void OnMaximumClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnMinimumChanged(EventArgs)

    Raises the OnMinimumChanged event.

    Declaration
    protected virtual void OnMinimumChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnMinimumClick(Object, EventArgs)

    Declaration
    protected virtual void OnMinimumClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnMouseDown(MouseEventArgs)

    Overridden. See System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs).

    Declaration
    protected override void OnMouseDown(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnMouseEnter(EventArgs)

    Declaration
    protected override void OnMouseEnter(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseLeave(EventArgs)

    Overridden. See System.Windows.Forms.Control.OnMouseLeave(System.EventArgs).

    Declaration
    protected override void OnMouseLeave(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseMove(MouseEventArgs)

    Overridden. See System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs).

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnMouseUp(MouseEventArgs)

    Overridden. See System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs).

    Declaration
    protected override void OnMouseUp(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    OnMovedPositionChanged(Int32, Int32)

    Occurs when mouse down and cursor change position.

    Declaration
    protected virtual void OnMovedPositionChanged(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x
    System.Int32 y

    OnPageDownRightClick(Object, EventArgs)

    Declaration
    protected virtual void OnPageDownRightClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnPageUpLeftClick(Object, EventArgs)

    Declaration
    protected virtual void OnPageUpLeftClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnPaint(PaintEventArgs)

    Overridden. See System.Windows.Forms.Control.OnPaint.

    Declaration
    protected override void OnPaint(PaintEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.PaintEventArgs e

    OnRightToLeftChanged(EventArgs)

    Redraws scroll control when RightToLeft is changed.

    Declaration
    protected override void OnRightToLeftChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnScrollDownRightClick(Object, EventArgs)

    Declaration
    protected virtual void OnScrollDownRightClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnScrollHereClick(Object, EventArgs)

    Declaration
    protected virtual void OnScrollHereClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnScrollUpLeftClick(Object, EventArgs)

    Declaration
    protected virtual void OnScrollUpLeftClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender
    System.EventArgs e

    OnSizeChanged(EventArgs)

    Occurs when control size changed.

    Declaration
    protected override void OnSizeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnSmallChangeChanged(EventArgs)

    Raises the OnSmallChangeChanged event.

    Declaration
    protected virtual void OnSmallChangeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnSystemColorsChanged(EventArgs)

    Overridden. See System.Windows.Forms.Control.OnSystemColorsChanged(System.EventArgs).

    Declaration
    protected override void OnSystemColorsChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnThemeEnabledChanged(EventArgs)

    Raises the OnMinimumChanged event.

    Declaration
    protected virtual void OnThemeEnabledChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    OnValueChanged(EventArgs)

    Raises the OnValueChanged event.

    Declaration
    protected virtual void OnValueChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    PointToValue(Int32, Int32)

    Declaration
    public virtual int PointToValue(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x
    System.Int32 y
    Returns
    Type
    System.Int32

    RecalculateArrow()

    Recalculates bounds of the arrow buttons.

    Declaration
    protected virtual void RecalculateArrow()

    RecalculateScroll()

    Recalculates bounds of the ScrollBarCustomDraw.

    Declaration
    protected virtual void RecalculateScroll()

    RecalculateThumb()

    Recalculates bounds of the thumb.

    Declaration
    protected virtual void RecalculateThumb()

    ResetToSystemMetrics()

    Reset control Width or Heigh to system settings

    Declaration
    protected virtual void ResetToSystemMetrics()

    SetControlsLayoutVisibility(Boolean)

    Excludes/includes controls in Controls collection.

    Declaration
    protected void SetControlsLayoutVisibility(bool hide)
    Parameters
    Type Name Description
    System.Boolean hide

    If true - excludes, else includes controls in Controls collection.

    SetSafeSmallChange(Int32)

    Sets small change if value is less than large change; otherwise sets small change to large change.

    Declaration
    public void SetSafeSmallChange(int value)
    Parameters
    Type Name Description
    System.Int32 value

    Value to set.

    ShouldSerializeControlsAfter()

    Declaration
    protected bool ShouldSerializeControlsAfter()
    Returns
    Type
    System.Boolean

    ShouldSerializeControlsBefore()

    Declaration
    protected bool ShouldSerializeControlsBefore()
    Returns
    Type
    System.Boolean

    ValidateControlsVisibility()

    Used for validating visibility of the ControlsAfter and ControlsBefore

    Declaration
    protected virtual void ValidateControlsVisibility()

    ValueToPoint(Int32)

    Declaration
    [Obsolete]
    public virtual Point ValueToPoint(int value)
    Parameters
    Type Name Description
    System.Int32 value
    Returns
    Type
    System.Drawing.Point

    Events

    ColorSchemeChanged

    Declaration
    public event EventHandler ColorSchemeChanged
    Event Type
    Type
    System.EventHandler

    LargeChangeChanged

    Declaration
    public event EventHandler LargeChangeChanged
    Event Type
    Type
    System.EventHandler

    MaximumChanged

    Declaration
    public event EventHandler MaximumChanged
    Event Type
    Type
    System.EventHandler

    MinimumChanged

    Declaration
    public event EventHandler MinimumChanged
    Event Type
    Type
    System.EventHandler

    SmallChangeChanged

    Declaration
    public event EventHandler SmallChangeChanged
    Event Type
    Type
    System.EventHandler

    ThemeEnabledChanged

    Declaration
    public event EventHandler ThemeEnabledChanged
    Event Type
    Type
    System.EventHandler

    ValueChanged

    Declaration
    public event EventHandler ValueChanged
    Event Type
    Type
    System.EventHandler

    VisualStyleChanged

    Declaration
    public event EventHandler VisualStyleChanged
    Event Type
    Type
    System.EventHandler
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved