I have 2 forms : Form1, Form2.
Form1 has checkedlistbox : checkedlistbox1
All i need is when i click a button from Form2 then checkedlistbox item should be clear.
From searching i found and applied this code but didn’t work.
using (Form1 form1 = new Form1())
{
form1.checkedListBox1.Items.Clear();
}
but didn’t work.
Please suggest some ideas.
Because when you do
you are actually creating a new instance of
Form1. That’s why it won’t work. You need to get the current instance ofForm1.or probably