Solved

checking a checkedlistbox for checkstate

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…

734 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