From Xojo Documentation

Revision as of 21:17, 26 June 2019 by Gperlman (talk | contribs)

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

Class (inherits from RectControl)

The scrollbar control.

Close GotFocus MouseExit
ConstructContextualMenu KeyDown MouseMove
ContextualMenuAction KeyUp MouseUp
DragEnter LostFocus MouseWheel
DragExit MouseDown Open
DragOver MouseDrag ValueChanged
DropObject MouseEnter

Active fa-lock-32.png LockLeft Scope fa-lock-32.png
AllowAutoDeactivate LockRight TabIndex
AllowFocus LockTop Tooltip
AllowLiveScrolling MaximumValue Top
AllowTabStop MinimumValue Transparent
Enabled MouseCursor TrueWindow fa-lock-32.png
Handle fa-lock-32.png MouseX fa-lock-32.png Value
Height MouseY fa-lock-32.png Visible
Index fa-lock-32.png Name fa-lock-32.png Width
Left PageStep Window fa-lock-32.png
LineStep PanelIndex
LockBottom Parent

AcceptFileDrop AcceptTextDrop Invalidate
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DrawInto SetFocus


A Scrollbar can be either horizontal or vertical. To set its orientation programatically, set the height to be greater than the width for a vertical scrollbar. Set the width to be greater than the height for a horizontal scrollbar. The default thickness of the short side is 16 pixels, but it can be changed. You can narrow it in the IDE to get a mini-scrollbar.


Changing the maximum value of a Scrollbar at runtime:

Scrollbar1.MaximumValue = 200

Setting the text of a Label, control to the value of the Scrollbar when the user scrolls:

Sub ValueChanged()
Label1.Value = Str(Scrollbar1.Value)
End Sub

See also the discussion of scrolling ListBox controls horizontally using a Scrollbar control.

See Also

Slider control; RectControl class.