Forum Topic: C# Checkedlistbox Control

(403 views • 1 reply)

This topic is 1 page long.

<< < > >>
None

TitusRevised

Reply To Post Reply & Quote

Posted at: 8/27/06 09:21 PM

TitusRevised LIGHT LEVEL 05

Sign-Up: 02/13/04

Posts: 391

using Visual C# 2005 Express Edition:
I have a checkedlistbox control on a form.
I have a button on the form.
In the buttons on click event, I want it to automatically check all the items in the checked list box. A check all/select all button.

How do I do this?


None

TitusRevised

Reply To Post Reply & Quote

Posted at: 8/27/06 09:33 PM

TitusRevised LIGHT LEVEL 05

Sign-Up: 02/13/04

Posts: 391

nevermind, i figured it out finally.
Just had to make a loop.

private void button4_Click(object sender, EventArgs e)
{
for (int c = 0; c < checkedListBox1.Items.Count;c++)
{
checkedListBox1.SetItemChecked(c, true);
}
}


All times are Eastern Standard Time (GMT -5) | Current Time: 09:25 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!