Skip to main content
A newer version of this page is available. .

ToggleSwitch Class

The check editor to edit Boolean values using a movable bar.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[DefaultBindingPropertyEx("IsOn")]
[SmartTagAction(typeof(ToggleSwitchActions), "On", "Switch On", SmartTagActionType.RefreshContentAfterExecute)]
[SmartTagAction(typeof(ToggleSwitchActions), "Off", "Switch Off", SmartTagActionType.RefreshContentAfterExecute)]
[SmartTagFilter(typeof(ToggleSwitchFilter))]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "ToggleSwitch")]
public class ToggleSwitch :
    BaseCheckEdit

Remarks

The ToggleSwitch is a Windows UI-style check editor that allows an end-user to switch between two states (On and Off).

ToggleSwitch.png

The editor’s state is specified by the ToggleSwitch.IsOn property. The ToggleSwitch.Toggle method inverts the current state.

The text displayed by the editor in the checked and unchecked states is specified by the RepositoryItemToggleSwitch.OnText and RepositoryItemToggleSwitch.OffText properties, available via the ToggleSwitch.Properties object. To hide the text, use the RepositoryItemToggleSwitch.ShowText property.

See Also