Table of Contents

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

orientation Orientation

Properties

AutoHide

Draws nothing (and ignores input) when everything fits in the viewport.

public bool AutoHide { get; set; }

Property Value

bool

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

IsScrollable

true when the content is larger than the viewport.

public bool IsScrollable { get; }

Property Value

bool

LargeChange

Page step (default: the viewport).

public double LargeChange { get; set; }

Property Value

double

MaxValue

Largest valid Value.

public double MaxValue { get; }

Property Value

double

Maximum

End of the content range (total content extent).

public double Maximum { get; set; }

Property Value

double

Minimum

Start of the content range.

public double Minimum { get; set; }

Property Value

double

Orientation

Direction.

public Orientation Orientation { get; set; }

Property Value

Orientation

ShowArrows

Shows arrow buttons at both ends.

public bool ShowArrows { get; set; }

Property Value

bool

SmallChange

Arrow / wheel step (default 10 % of the viewport).

public double SmallChange { get; set; }

Property Value

double

Value

First visible position.

public double Value { get; set; }

Property Value

double

ViewportSize

Visible extent (thumb size).

public double ViewportSize { get; set; }

Property Value

double

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

style VectorStyle
label Rect
widget Rect
value Rect

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

e MouseEventArgs

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

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Mouse button released.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseWheel(MouseEventArgs)

Mouse wheel over the element.

protected override void OnMouseWheel(MouseEventArgs e)

Parameters

e MouseEventArgs

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle

ScrollBy(double)

Scrolls by a delta as the user would (raises Scrolled).

public void ScrollBy(double delta)

Parameters

delta double

ScrollTo(double)

Scrolls to a position as the user would (raises Scrolled).

public void ScrollTo(double value)

Parameters

value double

Events

Scrolled

Raised when the user scrolls (new value).

public event Action<ScrollBar, double>? Scrolled

Event Type

Action<ScrollBar, double>