ScrollBar
Base scrollbar using Range numeric state.
Use HScrollBar or VScrollBar; automatic content scrolling normally calls for ScrollContainer. A standalone bar stores a number but does not move an arbitrary Control unless your code connects ValueChanged to it.
MinValue/MaxValue define the full range; Page is visible page size. The ordinary Value limit is MaxValue − Page: bounds 0…100 with Page = 20 end at 80. Page is not a wheel increment. Unlike base Range, the ScrollBar constructor sets Step = 0.
CustomStep defaults to -1: negative values use Step for arrow buttons and corresponding keys; nonnegative values supply their increment. It is neither Value snapping nor a universal increment for every scrolling method. With Step = 0 and negative CustomStep, those increments can be zero. The wheel uses Page / 8, or range / 16 when Page is zero, then respects Step and Range constraints.
ValueChanged is useful for ordinary value changes, including programmatic writes. Scrolling belongs to specific scrolling paths and is not emitted by ordinary Value assignment. SetValueNoSignal emits neither signal. Do not use Scrolling as a universal notification for every numeric change.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties1
CustomStepProperty
public float CustomStep { get; set; }Arrow-button and corresponding key increment; default -1 uses Step. Nonnegative values supply an increment; 0 can leave the number unchanged. Does not control wheel increments or snap programmatic Value writes.
Methods2
GetCustomStepfloat
public float GetCustomStep();Arrow-button and corresponding key increment; default -1 uses Step. Nonnegative values supply an increment; 0 can leave the number unchanged. Does not control wheel increments or snap programmatic Value writes.
floatStored float increment; a negative value means use Step.
SetCustomStepvoid
public void SetCustomStep(float step);Arrow-button and corresponding key increment; default -1 uses Step. Nonnegative values supply an increment; 0 can leave the number unchanged. Does not control wheel increments or snap programmatic Value writes.
| Name | Type | Default |
|---|---|---|
step | float | — |
stepArrow-button and corresponding key increment; default -1 uses Step. Nonnegative values supply an increment; 0 can leave the number unchanged. Does not control wheel increments or snap programmatic Value writes.
Signals and events1
ScrollingEvent
public event Action Scrolling;Signal for specific user-scrolling paths rather than every Range change. Ordinary Value assignment and SetValueNoSignal do not emit it. Use ValueChanged for ordinary numeric reactions.
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
icon_max_sizeint | The maximum allowed size of the 0 |
decrementTexture2D | Icon used as a button to scroll the |
decrement_highlightTexture2D | Displayed when the mouse cursor hovers over the decrement button. |
decrement_pressedTexture2D | Displayed when the decrement button is being pressed. |
incrementTexture2D | Icon used as a button to scroll the |
increment_highlightTexture2D | Displayed when the mouse cursor hovers over the increment button. |
increment_pressedTexture2D | Displayed when the increment button is being pressed. |
drag_ended_soundAudioStream | Played when mouse or touch drag ends. |
drag_started_soundAudioStream | Played when mouse or touch drag begins. |
value_change_rejected_soundAudioStream | Played when the value is attempted to be changed through keyboard or gamepad input, but the value is already at the minimum (or maximum). |
value_changed_soundAudioStream | Played when the value is changed through keyboard or gamepad input. If the value is already at the minimum (or maximum), |
grabberStyleBox | Used as texture for the grabber, the draggable element representing current scroll. |
grabber_highlightStyleBox | Used when the mouse hovers over the grabber. |
grabber_pressedStyleBox | Used when the grabber is being dragged. |
scrollStyleBox | Used as background of this |
scroll_focusStyleBox | Used as background when the |