Solved

checking a checkedlistbox for checkstate

Posted on 2006-11-30
2
511 Views
Last Modified: 2008-02-01
When code enters the checkedlistbox_ItemCheck event, I want to find out if the item is being checked or unchecked.  How do I do that?
0
Comment
Question by:g_johnson
2 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 450 total points
ID: 18049076
if e is the eventargs then :

e.CurrentValue is the current value of the item
e.NewValue is the value it will be set to
e.Index is the index of the item that is being checked
0
 
LVL 5

Assisted Solution

by:rameedev
rameedev earned 50 total points
ID: 18051957
Can you try this

private void checkedListBox1_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
            {
                  if(e.CurrentValue==CheckState.Checked)
                  {
                        MessageBox.Show("Current State is Checked");
                  }
                  else if(e.CurrentValue==CheckState.Unchecked)
                  {
                        MessageBox.Show("Current State is UnChecked");
                  }
                  else  
                  {
                        MessageBox.Show("Current State is Indeterminate");
                  }
            }
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question