Class ScrollBar
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Scroll bar over a content range: Value is the first visible position in [Minimum, Maximum − ViewportSize]. Thumb drag, track paging with auto-repeat, optional arrow buttons, mouse wheel. Used by scroll viewers, lists and tables.
public class ScrollBar : Control
- Inheritance
-
ScrollBar
- Inherited Members
Constructors
ScrollBar()
Creates a vertical scroll bar.
public ScrollBar()
ScrollBar(Orientation)
Creates a scroll bar.
public ScrollBar(Orientation orientation)
Parameters
orientationOrientation
Properties
AutoHide
Draws nothing (and ignores input) when everything fits in the viewport.
public bool AutoHide { get; set; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
IsScrollable
true when the content is larger than the viewport.
public bool IsScrollable { get; }
Property Value
LargeChange
Page step (default: the viewport).
public double LargeChange { get; set; }
Property Value
MaxValue
Largest valid Value.
public double MaxValue { get; }
Property Value
Maximum
End of the content range (total content extent).
public double Maximum { get; set; }
Property Value
Minimum
Start of the content range.
public double Minimum { get; set; }
Property Value
Orientation
Direction.
public Orientation Orientation { get; set; }
Property Value
ShowArrows
Shows arrow buttons at both ends.
public bool ShowArrows { get; set; }
Property Value
SmallChange
Arrow / wheel step (default 10 % of the viewport).
public double SmallChange { get; set; }
Property Value
Value
First visible position.
public double Value { get; set; }
Property Value
ViewportSize
Visible extent (thumb size).
public double ViewportSize { get; set; }
Property Value
Methods
LayoutParts(VectorStyle, out Rect, out Rect, out Rect)
Splits the bounds into label (top), widget and value (bottom) areas according to the style. Override to change the arrangement (e.g. label on the left for sliders).
protected override void LayoutParts(VectorStyle style, out Rect label, out Rect widget, out Rect value)
Parameters
styleVectorStylelabelRectwidgetRectvalueRect
OnCaptureLost()
The mouse capture was lost without a button release.
protected override void OnCaptureLost()
OnDetached()
Called when the element leaves its host (unsubscribe here).
protected override void OnDetached()
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseLeave()
The mouse left the element.
protected override void OnMouseLeave()
OnMouseMove(MouseEventArgs)
Mouse moved over the element (or captured).
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnMouseWheel(MouseEventArgs)
Mouse wheel over the element.
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
ScrollBy(double)
Scrolls by a delta as the user would (raises Scrolled).
public void ScrollBy(double delta)
Parameters
deltadouble
ScrollTo(double)
Scrolls to a position as the user would (raises Scrolled).
public void ScrollTo(double value)
Parameters
valuedouble
Events
Scrolled
Raised when the user scrolls (new value).
public event Action<ScrollBar, double>? Scrolled