Back to Devexpress

ToggleSwitch.EditValue Property

windowsforms-devexpress-dot-xtraeditors-dot-toggleswitch-60936cfe.md

latest2.3 KB
Original Source

ToggleSwitch.EditValue Property

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

Declaration

csharp
[Browsable(false)]
[DefaultValue(false)]
public override object EditValue { get; set; }
vb
<Browsable(False)>
<DefaultValue(False)>
Public Overrides Property EditValue As Object

Property Value

TypeDefaultDescription
Objectfalse

The editor’s edit value.

|

Remarks

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.

csharp
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;
vb
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

IsOn

ToggleSwitch Class

ToggleSwitch Members

DevExpress.XtraEditors Namespace