Class
MobileSlider
Description
A control with a draggable slider than can be used to change a value.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
constraint As iOSLayoutConstraint |
|||
child As MobileUIControl |
|||
index As Integer |
|||
constraint As iOSLayoutConstraint |
|||
child As MobileUIControl |
|||
Events
Name |
Parameters |
Returns |
---|---|---|
Property descriptions
MobileSlider.AccessibilityHint
AccessibilityHint As String
The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.
Me.AccessibilityHint = "Click to calculate the value and display the next screen."
MobileSlider.AccessibilityLabel
AccessibilityLabel As String
The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.
Me.AccessibilityLabel = "Calculate the value."
MobileSlider.ControlCount
ControlCount As Integer
The number of child controls in the control.
This property is read-only.
MobileSlider.Enabled
Enabled As Boolean
Indicates whether the control is enabled or disabled.
Disable the button:
Button1.Enabled = False
MobileSlider.Height
Height As Double
The height of the control.
This property is read-only.
MobileSlider.Left
Left As Double
The left position of the control.
This property is read-only.
MobileSlider.MaximumValue
MaximumValue As Double
The maximum value of the slider.
The default value is 100.
Change the maximum slider value:
MySlider.MaximumValue = 50
MobileSlider.MinimumValue
MinimumValue As Double
The minimum value of the slider.
The default value is 0.
Change the minimum slider value:
MySlider.MinimumValue = -50
MobileSlider.Name
Name As String
The name of the control.
MobileSlider.Parent
Parent As MobileUIControl
The parent (sometimes called a "Super") class of the control.
This property is read-only.
MobileSlider.TintColor
TintColor As ColorGroup
Changes a control's tint color.
On iOS, the following controls support TintColor:
Enum |
Description |
---|---|
ProgressBar |
The area indicating the value of the control will be drawn in the TintColor. |
Slider |
The area indicating the value of the control will be drawn in the TintColor. |
TextArea |
The cursor and text highlight color will be drawn in the TintColor. |
TextField |
The cursor and text highlight color will be drawn in the TintColor. |
MobileSlider.Top
Top As Double
The top position of the control.
This property is read-only.
MobileSlider.Value
Value As Double
The current value of the slider.
Set this value to move the slider position. If Value is greater than the MaximumValue, the MaximumValue is used. If Value is less than MinimumValue, then MinimumValue is used.
Set the initial slider value:
MySlider.Value = 25
MobileSlider.Visible
Visible As Boolean
Indicates whether the control is visible.
Make a button invisible:
Button1.Visible = False
MobileSlider.Width
Width As Double
The width of the control.
This property is read-only.
Method descriptions
MobileSlider.AddConstraint
AddConstraint(constraint As iOSLayoutConstraint)
Adds a constraint to the control.
This constraint is used by child controls that have been added to this control.
MobileSlider.AddControl
AddControl(child As MobileUIControl)
Adds a child control to the control.
MobileSlider.ClearFocus
ClearFocus
Removes the focus from the control.
TextField1.ClearFocus
MobileSlider.ControlAt
ControlAt(index As Integer) As MobileUIControl
Gets the child control at the specified index.
MobileSlider.Controls
Controls As Iterable
Allows you to iterate through all the controls that have been added to this control.
MobileSlider.Handle
Handle As Ptr
The a handle to the underlying native OS control.
MobileSlider.Refresh
Refresh
Marks the control so that it will be redrawn during the next event loop.
Call Refresh to force a Canvas to redraw itself:
Canvas1.Refresh
MobileSlider.RemoveConstraint
RemoveConstraint(constraint As iOSLayoutConstraint)
Removes a constraint from the control.
MobileSlider.RemoveControl
RemoveControl(child As MobileUIControl)
Removes the control from the control.
MobileSlider.SetFocus
SetFocus
Sets the focus to the control.
TextField1.SetFocus
Event descriptions
MobileSlider.Closing
Closing
Called when the control's layout is closing.
MobileSlider.Opening
Opening
Called when the control's layout is opening.
This is where you typically put initialization code.
This example in the Opening event of a label sets its text to "Hello":
Me.Text = "Hello"
MobileSlider.ValueChanged
ValueChanged
Called when Value is changed.
Update a Label with the value of the Slider as it changes:
MyLabel.Text = Me.Value.ToString
Compatibility
Mobile projects on all supported mobile operating systems.