---
title: "Checkbox Control in C#.Net"  
description: "Checkbox Control in C#.NetThe Checkbox control is used to display a checkbox. The Checkbox control gives us an option to select, say, yes/no or true"  
author: "Pushpendra Singh"  
published: 2011-01-24  
updated: 2020-03-12  
canonical: https://www.mindstick.com/articles/392/checkbox-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Checkbox Control in C#.Net

## Checkbox Control in C#.Net

The [Checkbox control](https://www.mindstick.com/articles/291/how-should-use-checkbox-control-in-vb-dot-net) is used to display a checkbox. The Checkbox control gives us an option to select, say, yes/no or true/false. A checkbox is clicked to select and clicked again to deselect some options. When a checkbox is selected, a check (a tick mark) appears indicating a selection.\

## How to use CheckBox Control

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) three checkboxes from the toolbox on [window form](https://www.mindstick.com/forum/527/how-to-pass-datagridview-s-cells-value-to-another-window-form).

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/e95af5a0-be9e-4dce-8845-727dc7f5a891.png)

## Code:

```
using System;using System.Text;using System.Windows.Forms; namespace WindowsFormsApplication1{     public partial class Form4 : Form    {         public Form4()         {            InitializeComponent();         }         private void checkBox1_CheckedChanged(object sender, EventArgs e)         {            //display checkbox value when checkbox1 is checked            label1.Text = "Selected Language is " + checkBox1.Text;         }          private void checkBox2_CheckedChanged(object sender, EventArgs e)         {            //display checkbox value when checkbox2 is checked            label1.Text = "Selected Language is " + checkBox2.Text;         }         private void checkBox3_CheckedChanged(object sender, EventArgs e)         {            //display checkbox value when checkbox3 is checked            label1.Text = "Selected Language is " + checkBox3.Text;         }    }}
```

**Run the [Project](https://yourviews.mindstick.com/story/1788/things-to-ensure-your-construction-project-is-successful)**

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/17cdb684-da8e-4cf5-a54d-ba0a66be7683.png)

When you select the given option then the CheckedChanged event will fire and the [selected value](https://www.mindstick.com/forum/525/get-selected-value-of-datagridviewcomboboxcolumn) will show in Label.

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/bb659087-5b51-4c95-a1ba-61cdd21301a6.png)

**CheckBox Control [Properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule)**

CheckState: The default value is Unchecked. Set it to True if you want a check to appear when form executed.

```
private void Form4_Load(object sender, EventArgs e){     'check will appear at run time      checkBox1.CheckState = CheckState.Checked;}     
```

## Output

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/c28653ac-4234-4677-91b4-bc24bc44a583.png)

When the [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) runs then checkBox1 check state is checked.

Appearance: [Default value](https://www.mindstick.com/forum/23023/default-value-when-using-singleordefault) is Normal. Set the value to Button if you want the CheckBox to be displayed as a Button.

```
private void Form4_Load(object sender, EventArgs e){         //'set checkbox appearance as button         checkBox1.Appearance = Appearance.Button;         checkBox2.Appearance = Appearance.Button;         checkBox3.Appearance = Appearance.Button;}
```

## Output

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/90334f1c-4e35-428e-9d66-c6a5c0787035.png)

Now checkbox will show a button.

**BackColor:**You can change the BackColor of CheckBox trough BackColor properties.

```
private void Form4_Load(object sender, EventArgs e){      // change the backcolor of checkbox        checkBox1.BackColor = System.Drawing.Color.CadetBlue;        checkBox2.BackColor = System.Drawing.Color.CadetBlue;        checkBox3.BackColor = System.Drawing.Color.CadetBlue;}
```

## Output

![Checkbox Control in C#.Net](https://www.mindstick.com/mindstickarticle/e4ef0470-6366-4a40-8a5c-34d6ddfd7cf5/images/574f3f74-7eb9-461a-ab5c-8c87d4534ec0.png)

At run, time checkbox backcolor will be changed.

---

Original Source: https://www.mindstick.com/articles/392/checkbox-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
