Display the No. of items checked in a Checked List Box
  • hi friends today i am going to explain how to display the no of items checked in checked list box

    i hope that it will use your priceless code

            private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)



            {



                mso-highlight:white">// Get the current number checked.



                mso-highlight:white">int num_checked =
    checkedListBox1.CheckedItems.Count;



                mso-highlight:white">// See if the item is being checked or unchecked.



                mso-highlight:white">if ((e.CurrentValue != white;mso-highlight:white">CheckState.Checked)
    &&(e.NewValue ==
    color:#2B91AF;background:white;mso-highlight:white">CheckState.Checked))



                    num_checked++;



                mso-highlight:white">if ((e.CurrentValue == white;mso-highlight:white">CheckState.Checked)
    &&(e.NewValue !=
    color:#2B91AF;background:white;mso-highlight:white">CheckState.Checked))



                    num_checked--;



                mso-highlight:white">// Display the count.



                label1.Text =
    checkedListBox1.Items.Count +
    "Courier New";color:#A31515;background:white;mso-highlight:white">" items,
    "
    + num_checked + white;mso-highlight:white">" selected";



            }line-height:115%;font-family:"Courier New"">


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative