Solved

checking a checkedlistbox for checkstate

Posted on 2006-11-30
2
513 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

617 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