I’m using this code to pass the selected item to a listbox called SelectedList. The problem is that nothing happens when I checked an item of my chekedlistbox, what can be the problem here?
public void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
selectedList.Items.Add(checkedListBox1.SelectedItem.ToString());
}
else
{
selectedList.Items.Remove(checkedListBox1.SelectedItem.ToString());
}
}
public void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
selectedList.Text = checkedListBox1.SelectedItem.ToString();
}
The solution to this problem was the event checkedListBox1_ItemCheck was not activated in the event tab, that was the reason the compiler didn’t considered it in the debugging process.