Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckedListBox

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
I'm a Windows programming newb.

Does anyone know how to 1. read and set the checked state of one of the list's items programmatically (perhaps through binding) or 2. if there's a simple way to get a collection of the non-checked items?
 
It turns out there are Set... and Get... checked methods.
 
string s;
if(checkedListBox1.Items.Count > 0)
for(int j=0; j<checkedListBox1.Items.Count; j++)
{
// check for all non-checked items
if(checkedListBox1.GetItemChecked(j) == false)
{
s = checkedListBox1.Items[j].ToString();
// set checked
checkedListBox1.SetItemChecked(j, true);
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top