public void LoadData() { int n = DataBasee.Lister.Count(); NameSelectCheckBox[] checkBox = new NameSelectCheckBox[n]; GunaSeparator[] separator = new GunaSeparator[n]; for (int i = 0; i < n; i++) { checkBox[i] = new NameSelectCheckBox { Title = DataBasee.Lister[i].Title, Checked = false, Instance = i, }; var Temp = new CheckedNames() { Instence = i, DatabaseIndex = i, }; DataBasee.checkedNames.Add(Temp); separator[i] = new GunaSeparator { Width = 340, }; // Console.WriteLine(checkBox[i].Text); flowLayoutPanel1.Controls.Add(checkBox[i]); flowLayoutPanel1.Controls.Add(separator[i]); } }
private void gunaWinSwitch1_CheckedChanged(object sender, EventArgs e) { flowLayoutPanel1.Controls.Clear(); if (gunaWinSwitch1.Checked == true) { int n = DataBasee.Lister.Count(); NameSelectCheckBox[] checkBox = new NameSelectCheckBox[n]; GunaSeparator[] separator = new GunaSeparator[n]; for (int i = 0; i < n; i++) { checkBox[i] = new NameSelectCheckBox { Title = DataBasee.Lister[i].Title, Checked = true, Instance = i, }; separator[i] = new GunaSeparator { Width = 340, }; // Console.WriteLine(checkBox[i].Text); flowLayoutPanel1.Controls.Add(checkBox[i]); flowLayoutPanel1.Controls.Add(separator[i]); } } else if (gunaWinSwitch1.Checked == false) { int n = DataBasee.Lister.Count(); NameSelectCheckBox[] checkBox = new NameSelectCheckBox[n]; GunaSeparator[] separator = new GunaSeparator[n]; for (int i = 0; i < n; i++) { checkBox[i] = new NameSelectCheckBox { Title = DataBasee.Lister[i].Title, Checked = false, Instance = i, }; separator[i] = new GunaSeparator { Width = 340, }; // Console.WriteLine(checkBox[i].Text); flowLayoutPanel1.Controls.Add(checkBox[i]); flowLayoutPanel1.Controls.Add(separator[i]); } } }