Difference between revisions of "Scrollbar"
From Xojo Documentation
m (1 revision) |
|||
(22 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{DeprecatedItem|version=2021r3|replacement=[[DesktopScrollbar]]}} | ||
+ | {{ClassBox | ||
+ | | super=[[RectControl]] | ||
+ | | platform=all | ||
+ | | scope=global | ||
+ | }} | ||
+ | {{Description | ||
+ | | text=The scrollbar control. | ||
+ | }} | ||
+ | <dynamicTable id="Events" super="RectControl" class="eventTable" title="Events" columns="3"> | ||
+ | {{Event | name=GotFocus | description=GotFocus()
The scrollbar has received the focus (Windows and Linux). }} | ||
+ | {{Event | name=LostFocus | description=LostFocus()
The scrollbar has lost the focus (Windows and Linux). }} | ||
+ | {{Event | name=MouseDown | params=x as [[Integer]],y as [[Integer]] | returntype=[[Boolean]] | description=MouseDown(x as Integer,y as Integer) as Boolean
The mouse button was pressed inside the scrollbar at the location passed in to x,y }} | ||
+ | {{Event | name=MouseDrag | params=x as [[Integer]], y as [[Integer]] | description=MouseDrag(x as Integer, y as Integer)
The mouse button was pressed inside the Scrollbar and moved (dragged) at the location local to the control passed in to x,y }} | ||
+ | {{Event | name=MouseUp | params=x as [[Integer]], y as [[Integer]] | description=MouseUp(x as Integer, y as Integer)
The mouse button was released inside the scrollbar at the location passed in to x,y. }} | ||
+ | {{Event | name=ValueChanged | description=ValueChanged()
The scrollbar value has changed. }} | ||
+ | </dynamicTable> | ||
− | |||
− | |||
+ | <dynamicTable id="Properties" super="RectControl" class="propertyTable" title="Properties" columns="3"> | ||
+ | {{Property | name=AllowFocus | type=Boolean | platform=all | description=( Boolean) If True, the Scrollbar can accept the focus. The default is False. }} | ||
+ | {{Property | name=AllowLiveScrolling | type=Boolean | platform=all | readonly=no | description=( Boolean) If True, a ValueChanged event occurs as the user drags the thumbnail in the scrollbar. }} | ||
+ | {{Property | name=LineStep | type=Integer | platform=all | description=( Integer) The amount the value changes when a scroll arrow is clicked. The default is 1. }} | ||
+ | {{Property | name=MaximumValue | type=Integer | platform=all | description=( Integer) The maximum value of the scrollbar. The default is 100. }} | ||
+ | {{Property | name=MinimumValue | type=Integer | platform=all | description=( Integer) The minimum value of the scrollbar. The default is 0. }} | ||
+ | {{Property | name=PageStep | type=Integer | platform=all | description=( Integer) The amount the value changes when the user clicks in the Scrollbar track. }} | ||
+ | {{Property | name=Value | type=Integer | platform=all | description=( Integer) The current value of the scrollbar. }} | ||
+ | </dynamicTable> | ||
− | == | + | <dynamicTable id="Methods" super="RectControl" class="methodTable" title="Methods" columns="3"> |
− | + | </dynamicTable> | |
− | + | ==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. | 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: | Changing the maximum value of a '''Scrollbar''' at runtime: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <rbcode> | |
+ | Scrollbar1.MaximumValue = 200 | ||
+ | </rbcode> | ||
+ | Setting the text of a [[Label]], control to the value of the '''Scrollbar''' when the user scrolls: | ||
+ | <rbcode> | ||
+ | Sub ValueChanged() | ||
+ | Label1.Value = Str(Scrollbar1.Value) | ||
+ | End Sub | ||
+ | </rbcode> | ||
− | + | See also the discussion of scrolling [[ListBox]] controls horizontally using a '''Scrollbar''' control. | |
− | |||
+ | ==See Also== | ||
+ | [[Slider]] control; [[RectControl]] class. | ||
− | [[Category: | + | [[Category:Desktop]] |
− | [[Category: | + | [[Category:Desktop Controls]] |
Latest revision as of 20:55, 13 September 2021
![]() |
This item was deprecated in version 2021r3. Please use DesktopScrollbar as a replacement. |
Class (inherits from RectControl)
The scrollbar control.
Properties | ||||||||||||||||||||||||||||||||||
|
Methods | |||||||||
|
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:
See also the discussion of scrolling ListBox controls horizontally using a Scrollbar control.
See Also
Slider control; RectControl class.