Back to Devexpress

CheckEdit.Toggle() Method

windowsforms-devexpress-dot-xtraeditors-dot-checkedit-0ed784d2.md

latest4.2 KB
Original Source

CheckEdit.Toggle() Method

Changes the state of a check editor.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public override void Toggle()
vb
Public Overrides Sub Toggle

Remarks

The Toggle method is used to toggle the states of a check editor.

If the RepositoryItemCheckEdit.AllowGrayed property of the RepositoryItemCheckEdit object available via the CheckEdit.Properties property is set to false (the default behavior), the method toggles checked and unchecked states only. You can read the CheckEdit.Checked or the CheckEdit.CheckState property to get the current state of your check editor.

When the RepositoryItemCheckEdit.AllowGrayed property is true , successive calls to the Toggle method select the unchecked, checked and grayed states. In this case,the check editor’s current state can be obtained via the CheckEdit.CheckState property.

This method is used internally and you may never need to call it from your applications.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Toggle() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-toggle-checkbox-state-with-one-click/CS/Form1.cs#L68

csharp
if (edit == null) return;
edit.Toggle();
DXMouseEventArgs.GetMouseArgs(e).Handled = true;

winforms-grid-change-checkbox-state-single-click-in-multi-select-mode/CS/Form1.cs#L49

csharp
if (edit == null) return;
edit.Toggle();
DXMouseEventArgs.GetMouseArgs(e).Handled = true;

winforms-grid-toggle-checkbox-state-with-one-click/VB/Form1.vb#L61

vb
If edit Is Nothing Then Return
edit.Toggle()
DXMouseEventArgs.GetMouseArgs(e).Handled = True

winforms-grid-change-checkbox-state-single-click-in-multi-select-mode/VB/Form1.vb#L43

vb
If edit Is Nothing Then Return
edit.Toggle()
DXMouseEventArgs.GetMouseArgs(e).Handled = True

See Also

AllowGrayed

Checked

CheckState

CheckEdit Class

CheckEdit Members

DevExpress.XtraEditors Namespace