Uncheck checked item in a checkedlistbox using button control

Satyapriyanayak
Posted by Satyapriyanayak under C# category on | Points: 40 | Views : 1497
Here 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);
}
}
}
}

Comments or Responses

Login to post response