I have a problem
My program has 2 form
1: form1 - main form
2: form3 - history browser - to load ariables from "database" (simple csv file) into form1 (Main) controls..
form3 should load and pass variables to form1 controls.text
I have only problem with ckheckedListBox in form3 - and I probably know why:
Form1 f1 = new Form1(cfg_name);
f1.comboBox_Maintenance_incident.Text = return_data[3];
f1.comboBox_Type.Text = return_data[4];
f1.comboBox_Affected_Item.Text = return_data[5];
temp = return_data[6].Split(';');
for (int i = 0; i < temp.Count(); i++)
{
int index = 0;
foreach (object item in f1.checkedListBox_Items.Items)
{
if (temp[i] == item.ToString())
{
f1.checkedListBox_Items.SetItemChecked(index, true);
}
index++;
}
}
This loop compare texts from temp array and if the that text matches with the text of any item from checklistbox - it ticks it.
the inner loop (foreach) even does not start...I suspect that it happens because Form1 is already closed - so there are no items to compare and to check if the condition is fullfilled..
I start form2 from main form - this way:
Form3 f3 = new Form3();
this.Hide();
f3.Show();
this.Close();
f3.Activate();
thx for help in advance...I really dont know how to overcome my problem...To check items from other form without creating the new instance :(