Scrollbar

From Xojo Documentation

Revision as of 13:48, 24 October 2018 by PLefebvre (talk | contribs) (See Also)

Class (inherits from RectControl)

The scrollbar control.

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


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


Methods
AcceptFileDrop AcceptTextDrop Invalidate
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DrawInto SetFocus

Notes

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.

Examples

Changing the maximum value of a Scrollbar at runtime:

Scrollbar1.Maximum = 200

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

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

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

See Also

Slider control; RectControl class.