windowsforms-devexpress-dot-xtraeditors-dot-toggleswitch-60936cfe.md
Gets or sets the editor’s edit value, which specifies the editor’s check state.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Browsable(false)]
[DefaultValue(false)]
public override object EditValue { get; set; }
<Browsable(False)>
<DefaultValue(False)>
Public Overrides Property EditValue As Object
| Type | Default | Description |
|---|---|---|
| Object | false |
The editor’s edit value.
|
To get or set the editor’s check state as a Boolean value, use the ToggleSwitch.IsOn property. The EditValue property, which is in sync with the ToggleSwitch.IsOn property, returns the editor’s check state as a value of the Object type.
The code sample below illustrates how to check the control’s EditValue.
if (toggleSwitch1.EditValue.ToString() == "True" && XtraMessageBox.Show("Are you sure you want to enable this functionality?", "Warning:", MessageBoxButtons.YesNo) == DialogResult.Yes)
// Implement the needed functionality
else
toggleSwitch1.IsOn = false;
If toggleSwitch1.EditValue.ToString() = "True" AndAlso XtraMessageBox.Show("Are you sure you want to enable this functionality?", "Warning:", MessageBoxButtons.YesNo) = DialogResult.Yes Then
' Implement the needed functionality
Else
toggleSwitch1.IsOn = False
End If
See Also