Code360 powered by Coding Ninjas X Code360 powered by Coding Ninjas X
Table of contents
C# CheckBox Control
Design Time
Run Time
Important Properties of CheckBox 
Important Events on CheckBox
Is C# different from C++?
What is C# used for?
Why is C# so popular?
Which is faster C++ or C#?
Is C# or C++ better for games?
Last Updated: Mar 27, 2024

C# CheckBox Control

Author Komal Shaw
0 upvote
Master Python: Predicting weather forecasts
Ashwin Goyal
Product Manager @


The CheckBox control allows us to select one or more things from a list and provide options such as yes or no, true or false, and so on. It can be shown as a picture, text, or both. The CheckBox is a class that is found in the System. Windows. Forms namespace.

Recommended Topic, Palindrome in C#, singleton design pattern in c# and Ienumerable vs Iqueryable

C# CheckBox Control

CheckBoxes allow the user to make numerous choices from a list of possibilities. Give the user a choice, such as true/false or yes/no, with a checkbox. A check box can be selected by clicking it once and then deselected by clicking it again.

We can create a checkbox in two different ways:

  1. Using Form Designer at design time.
  2. Using CheckBox class in code at run time.
Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job

Design Time

Steps to create a checkbox are-

  1. Create a windows form:
    Visual Studio -> File -> New -> Project -> WindowsFormApp 
  2. Drag and drop the CheckBox control from the ToolBox onto the Windows form. CheckBoxes can be placed wherever on the Windows form to suit your needs.
  3. After dragging and dropping, navigate to the CheckBox control's properties to change the CheckBox design to your liking.

Run Time

It's a little more difficult than the previous way. Using the CheckBox class, you can create your own checkbox programmatically in this method.

  1. Create a checkbox using the CheckBox() constructor provided by the CheckBox class.
    CheckBox Mycheckbox = new CheckBox();
  2. After creating CheckBox, set the properties of the CheckBox provided by the CheckBox class. 
    Mycheckbox.Height = 40; // Set height of the checkbox
    Mycheckbox.Width = 80; // Set width of the checkbox
    Mycheckbox.Location = new Point(229, 136); // Set location of the checkbox
    Mycheckbox.Text = "Married"; // Set text in the checkbox
    Mycheckbox.Font = new Font("Bradley Hand ITC", 12); // Set font of the checkbox
  3. And last, add this checkbox control to the form using Add() method. 

Important Properties of CheckBox 



This property is used to get or set the value that indicates the appearance of a CheckBox control.


When you click the CheckBox, this property is used to set a value that indicates whether the Checked or CheckState values, as well as the CheckBox look, are immediately modified.


This property is used to get or set a value that determines whether the control resizes based on its contents.


This property is used to get or set the background color of the control.


This property is used to get or set the background image displayed in the control.


This property is used to get or set the horizontal and vertical alignment of the checkmark on a CheckBox control.


This property is used to get the list of event handlers that are attached to this Component.


This property is used to get or set the font of the text displayed by the control.


This property is used to get or set the image that is displayed on a checkbox control.


This property is used to acquire or set the coordinates of the CheckBox control's upper-left corner in relation to the form's upper-left corner.


This property is used to get or set the alignment of the text on the CheckBox control. 


This property gets or sets a value that determines whether the control and all of its child controls are displayed.


Important Events on CheckBox



This event occurs when the value of the Checked property changes.


This event occur when the value of the CheckState property changes.


This event occurs when the control is clicked.


This event occurs when the user double-clicks the CheckBox control.


This event occurs when the input focus leaves the control.


This event occur when the control is clicked by the mouse.



Is C# different from C++?

C++ is an intermediate-level language that extends C with object-oriented capabilities, whereas C# is a high-level language. C++ compiles programs to Machine Codes, whereas C# compiles programs to CLR or Common Language Runtime.

What is C# used for?

C# may be used to construct a variety of programs and applications, including mobile apps, desktop apps, cloud-based services, websites, enterprise software, and games, just like other general-purpose programming languages.

Why is C# so popular?

C# has the advantage of being able to construct applications for both mobile and computer devices. It is also extensively used by the open-source community to create software applications utilizing various frameworks like Mono and the.NET Framework.

Which is faster C++ or C#?

C++ code is substantially faster than C# code, making it a superior choice for applications that require high speed. Your network analysis software, for example, may require C++ code, but performance is unlikely to be an issue for a conventional word processing application written in C#.

Is C# or C++ better for games?

C# and C++ can both be used to make games. C++, on the other hand, has better hardware control on the PC or server. As a result, it's usually a better choice for game creation. Both languages, on the other hand, are for game creation, especially since you won't be making games from scratch (usually).


In this article, we have extensively discussed the C# CheckBox Control. We hope that this blog has helped you enhance your knowledge regarding the C# CheckBox Control and if you would like to learn more, check out our articles on Basics of C#Methods in C#, and Type Conversion in C#.

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. 

Enrol in our courses and refer to the mock test and problems available.

Take a look at the interview experiences and interview bundle for placement preparations.


Do upvote our blog to help other ninjas grow. 

Happy Coding!

Previous article
C# RadioButton Control
Next article
C# TextBox Control
Live masterclass