A scrollbar control that displays scroll position and allows dragging to scroll content. Typically used internally by ScrollView but can also be used standalone.
Basic Usage
// Vertical scrollbar (default)newScrollbar().SetOrientation(ScrollbarOrientation.Vertical).SetOnValueChanged(offset=>Console.WriteLine($"Scrolled to {offset}"))// Horizontal scrollbarnewScrollbar().SetOrientation(ScrollbarOrientation.Horizontal).SetWidth(10)
Scrollbar-Specific Methods
Method
Description
SetOrientation(ScrollbarOrientation)
Sets vertical or horizontal orientation
BindOrientation(getter)
Binds orientation
SetWidth(float)
Sets scrollbar width/thickness (default: 12)
BindWidth(getter)
Binds width
SetMinThumbSize(float)
Sets minimum thumb size (default: 20)
BindMinThumbSize(getter)
Binds minimum thumb size
SetOnValueChanged(Action<float>)
Sets callback when scroll position changes
BindOnValueChanged(getter)
Binds value changed callback
ScrollbarOrientation Values
Value
Description
ScrollbarOrientation.Vertical
Vertical scrollbar (default)
ScrollbarOrientation.Horizontal
Horizontal scrollbar
Appearance Methods
Method
Description
SetThumbColor(Color)
Sets thumb color (default: gray)
BindThumbColor(getter)
Binds thumb color
SetThumbHoverColor(Color)
Sets thumb color on hover
BindThumbHoverColor(getter)
Binds hover color
SetThumbDragColor(Color)
Sets thumb color while dragging
BindThumbDragColor(getter)
Binds drag color
SetTrackColor(Color)
Sets track background color
BindTrackColor(getter)
Binds track color
SetThumbCornerRadius(float)
Sets thumb corner radius (default: 4)
BindThumbCornerRadius(getter)
Binds thumb corner radius
SetTrackCornerRadius(float)
Sets track corner radius (default: 4)
BindTrackCornerRadius(getter)
Binds track corner radius
Auto-Hide Methods
Method
Description
SetAutoHide(bool)
Enables auto-hide when not in use (default: false)