Let me re-state your question to see if I understand you correctly.
You have two forms. First form has a check list box, and the second form has a listbox.
When the user checks an item in the check list box, you want that item to be added to the listbox on form 2. If the user unchecks the checkbox item, then do nothing.
If the user clicks an item in the listbox, you want to make sure the checklist box item on form 1 is checked.
To do this, form 2 must be visible to form1, and the listbox must have its modifier property set to public.
Create an event handler on the checklistbox, so that when a user changes the state of a check box to checked, it will see if this item exists in the listbox. If not, then add it.
When creating form2 , add an event handler in form1 for the listbox Click event, and have it verify the corresponding checkbox is checked.
public partial class Form1 : Form
{
private Form2 form2;
public Form1()
{
InitializeComponent();
form2 = new Form2();
form2.listBox1.Click += new EventHandler(listBox1_Click);
form2.Show();
}
void listBox1_Click(object sender, EventArgs e)
{
int i = form2.listBox1.SelectedIndex;
string item = form2.listBox1.Items[i].ToString();
int y = checkedListBox1.Items.IndexOf(item);
checkedListBox1.SetItemCheckState(y, CheckState.Checked);
}
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
string item = checkedListBox1.Items[e.Index].ToString();
if (form2.listBox1.Items.IndexOf(item) == -1)
form2.listBox1.Items.Add(item);
}
}
}
Error checking not included...