Blog

Uncheck checked item in a checkedlistbox using button control

Posted by Satyapriya Nayak Blogs | Visual C# Oct 18, 2012
In this blog we will know how to uncheck checked item in a checkedlistbox using button control.
In this blog we will know how to uncheck checked item in a checkedlistbox using button control.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

 
namespace Uncheck_checkeditem_checkedlistbox
{
   
public partial class Form1 : Form
   
{
       
public Form1()
       
{
           
InitializeComponent();
       
}
       
private void Form1_Load(object sender, EventArgs e)
       
{
           
checkedListBox1.Items.Add("Raj");
           
checkedListBox1.Items.Add("Ravi");
           
checkedListBox1.Items.Add("Rahul");
           
checkedListBox1.Items.Add("Rajesh");
       
}       
        private void btn_Uncheck_Click(object sender, EventArgs e)
       
{
           
while (checkedListBox1.CheckedIndices.Count > 0)
           
{
               
checkedListBox1.SetItemChecked(checkedListBox1.CheckedIndices[0], false);
           
}
       
}
   
}
}

COMMENT USING
PREMIUM SPONSORS
Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.