private void extButton2_Click(object sender, EventArgs e) { CheckedListBoxForm f = new CheckedListBoxForm(); f.Items.AddRange(new string[] { "One", "Two", "Three", "Four" }); f.PositionBelow(extButton2, new Size(200, 500)); f.SetChecked("Two;Four"); f.CheckedChanged += F_CheckedChanged; f.Show(this); }
public static List <string> ShowCheckBoxOptionsForm(IList items, Control parentControl) { CheckedListBoxForm popup = new CheckedListBoxForm(); CheckBoxOptionsController popupController = new CheckBoxOptionsController(popup, items); popupController.LoadView(); DialogResult dialogResult = popup.ShowDialog(parentControl); popup.Dispose(); return(popupController.SelectedItems); }
private void button17_Click(object sender, EventArgs e) { if (cc == null) { Button b = sender as Button; cc = new CheckedListBoxForm(); cc.Items.Add("One"); cc.Items.Add("Two"); cc.Items.Add("Three four five six seven eight nine ten"); cc.Items.Add("Four"); cc.FormClosed += FormClosed2; cc.PositionBelow(b, new Size(b.Width, 400)); cc.Show(); } else { cc.Close(); } }
private void FormClosed2(Object sender, FormClosedEventArgs e) { cc = null; }