Difference between revisions of "Scrollbar"

From Xojo Documentation

m (See Also)
Line 19: Line 19:
  
 
<dynamicTable id="Properties" super="RectControl" class="propertyTable" title="Properties" columns="3">
 
<dynamicTable id="Properties" super="RectControl" class="propertyTable" title="Properties" columns="3">
{{Property | name=AcceptFocus | type=Boolean | platform=all | newinversion=2005r1 | description=( Boolean)&nbsp;&nbsp;If True, the Scrollbar can accept the focus. The default is False. }}
+
{{Property | name=AllowFocus | type=Boolean | platform=all | description=( Boolean)&nbsp;&nbsp;If True, the Scrollbar can accept the focus. The default is False. }}
 +
{{Property | name=AllowLiveScrolling | type=Boolean | platform=all | readonly=no | description=( Boolean)&nbsp;&nbsp;If True, a ValueChanged event occurs as the user drags the thumbnail in the scrollbar. }}
 
{{Property | name=LineStep | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The amount the value changes when a scroll arrow is clicked. The default is 1. }}
 
{{Property | name=LineStep | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The amount the value changes when a scroll arrow is clicked. The default is 1. }}
{{Property | name=LiveScroll | type=Boolean | platform=all | readonly=no | description=( Boolean)&nbsp;&nbsp;If True, a ValueChanged event occurs as the user drags the thumbnail in the scrollbar }}
+
{{Property | name=MaximumValue | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The maximum value of the scrollbar. The default is 100.  }}
{{Property | name=Maximum | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The maximum value of the scrollbar. The default is 100.  }}
+
{{Property | name=MinimumValue | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The minimum value of the scrollbar. The default is 0. }}
{{Property | name=Minimum | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The minimum value of the scrollbar. The default is 0. }}
 
 
{{Property | name=PageStep | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The amount the value changes when the user clicks in the Scrollbar track. }}
 
{{Property | name=PageStep | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The amount the value changes when the user clicks in the Scrollbar track. }}
 
{{Property | name=Value | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The current value of the scrollbar. }}
 
{{Property | name=Value | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The current value of the scrollbar. }}
Line 39: Line 39:
  
 
<rbcode>
 
<rbcode>
Scrollbar1.Maximum = 200
+
Scrollbar1.MaximumValue = 200
 
</rbcode>
 
</rbcode>
  
Line 46: Line 46:
 
<rbcode>
 
<rbcode>
 
Sub ValueChanged()
 
Sub ValueChanged()
   Label1.Text = Str(Scrollbar1.Value)
+
   Label1.Value = Str(Scrollbar1.Value)
 
End Sub
 
End Sub
 
</rbcode>
 
</rbcode>

Revision as of 21:17, 26 June 2019

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
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


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.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.