Solved

checking a checkedlistbox for checkstate

Posted on 2006-11-30
2
507 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now