Click here to Skip to main content
Click here to Skip to main content

Tagged as

CheckList Box and List Box

, 14 May 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
How to show the checked items of the check list box in listbox?


This post is about how to work with checklist box and list box.


The earlier post showed how to load the form with checked items is the checklist box.

This one is to show which items are checked in the check list box in list box.

Using the Code

The basic code is given below:

public Form1()
	checkedListBox1.Items.Add("Red Hat");
	checkedListBox2.Items.Add("RHCE 125");
   checkedListBox2.Items.Add("RHCE 255");
	checkedListBox2.Items.Add("Let Us C");
   checkedListBox2.Items.Add("Black Book Of MCTS");

 private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)

	 if (e.NewValue == CheckState.Checked)

 	else if (e.NewValue == CheckState.Unchecked)

private void checkedListBox2_ItemCheck(object sender, ItemCheckEventArgs e)

	if (e.NewValue == CheckState.Checked)

	else if (e.NewValue == CheckState.Unchecked)

The above is written in Visual C#.

1. Form is loaded with items in both checkbox list.

2. Checked items are shown in the list box form the checkbox list.

3. Checked items are removed form the listbox.


In the previous CheckListBox, we learned about the checked items.

In this, the base is the same but the difference is showing the checked list items in list box.

Thank you.
Santosh Shrestha.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Nepal Nepal
No Biography provided

Comments and Discussions

GeneralMy vote of 1 PinmemberWarrick Procter16-May-11 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 14 May 2011
Article Copyright 2011 by Santoshshrest
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid