Mobile Switch
From Xojo Documentation
A Switch has an on/off position and is used to choose a preference. When the Switch is on, it appears with a green background.
Below are commonly used events and properties. See the MobileSwitch for the complete list.
Events
ValueChanged - Called when the value for the Switch is changed, either by the user clicking on it or by code changing its Value property.
Properties
Enabled - A boolean that indicates if the switch is enabled and can be tapped or disabled and cannot be changed.
Value - A boolean that indicates the state of the Switch. When True, the Switch is on and displays with a green background. When False, the Switch is off.
Usage
To turn a switch on, set its value property:
This code in the ValueChanged event handler enables or disables a Text Field depending on whether a Switch is on or off:
Example Projects
- Examples/iOS/Controls/SwitchExample
See Also
MobileSwitch class