public partial class Form1 : Form
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
// Get selected index, and then make sure it is valid.
int selected = checkedListBox1.SelectedIndex;
if (selected != -1)
this.Text = checkedListBox1.Items[selected].ToString();
Items. It is also possible to edit the Items at design time. In Visual Studio, select Properties and then Items on the CheckedListBox instance.
CheckOnClick. When CheckOnClick is False, the user must click a second time after an item is selected to check the box. When True, the user must only click once to check a box.
IntegralHeight. It is possible to use the IntegralHeight property on the CheckedListBox to ensure that no partial items are shown.
Enabled. With the CheckedListBox, setting Enabled to False will gray out all the items in the control. It will also make them unclickable and unselectable.
ThreeDCheckBoxes. By default, the CheckedListBox has checkboxes that have a flat, single-pixel border. A more 3D appearance may be desirable—set the ThreeDCheckBoxes property to true.
Summary. CheckedListBox is useful for displaying a large or dynamic set of items that can be checked by the user. It has a many properties that adjust appearance and behavior.
Dot Net Perls is a collection of tested code examples. Pages are continually updated to stay current, with code correctness a top priority.
Sam Allen is passionate about computer languages. In the past, his work has been recommended by Apple and Microsoft and he has studied computers at a selective university in the United States.
This page was last updated on Sep 29, 2022 (edit).