windowsforms-devexpress-dot-xtraeditors-dot-checkbutton.md
Gets or sets the button’s check state.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(false)]
[DXCategory("Appearance")]
public virtual bool Checked { get; set; }
<DXCategory("Appearance")>
<DefaultValue(False)>
Public Overridable Property Checked As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true if the button is checked (in the depressed state); false if the button is unchecked (in the elevated state).
|
CheckButton controls have two logical states - checked and unchecked. Use the Checked property to set the check state. It’s possible to swap the check state via the CheckButton.Toggle method.
To respond to a button’s state being changed, handle the CheckButton.CheckedChanged event.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Checked property.
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-scheduler-customize-appointment-flyout/CS/CustomAppointmentFlyoutExample/Form1.cs#L104
private void chkBtnTooltips_CheckedChanged(object sender, EventArgs e) {
if (chkBtnTooltips.Checked) {
#region #AllowDisplayAppointmentFlyout
how-to-use-docvariable-fields/CS/DocumentVariablesExample/Form1.cs#L127
Document doc = richEdit.Document;
bool showCodes = btn_ShowCodes.Checked;
doc.BeginUpdate();
winforms-scheduler-formatting-services/CS/FormattingServicesExample/Form1.cs#L55
private void checkButton1_CheckedChanged(object sender, EventArgs e) {
if (checkButton1.Checked) {
schedulerControl1.RemoveService(typeof(IAppointmentFormatStringService));
winforms-richedit-layout-api/CS/Form1.cs#L111
{
if (checkbtnCustomDraw.Checked)
{
winforms-grid-hide-vertical-lines-between-certain-columns/CS/E3647/Form1.cs#L88
{
helper.Hide = checkButton1.Checked;
}
winforms-scheduler-customize-appointment-flyout/VB/CustomAppointmentFlyoutExample/Form1.vb#L114
Private Sub chkBtnTooltips_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
If chkBtnTooltips.Checked Then
#Region "#AllowDisplayAppointmentFlyout"
how-to-use-docvariable-fields/VB/DocumentVariablesExample/Form1.vb#L121
Dim doc As Document = richEdit.Document
Dim showCodes As Boolean = btn_ShowCodes.Checked
doc.BeginUpdate()
winforms-scheduler-formatting-services/VB/FormattingServicesExample/Form1.vb#L63
Private Sub checkButton1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
If checkButton1.Checked Then
schedulerControl1.RemoveService(GetType(IAppointmentFormatStringService))
winforms-richedit-layout-api/VB/Form1.vb#L92
Private Sub checkbtnCustomDraw_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles checkbtnCustomDraw.CheckedChanged
If checkbtnCustomDraw.Checked Then
AddHandler richEditControl1.BeforePagePaint, AddressOf richEditControl1_BeforePagePaint
winforms-grid-hide-vertical-lines-between-certain-columns/VB/E3647/Form1.vb#L86
If helper IsNot Nothing Then
helper.Hide = checkButton1.Checked
End If
See Also