Solved

checking a checkedlistbox for checkstate

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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