/// <summary> /// Shows the dialog. /// </summary> /// <param name="labelText">The label text.</param> /// <param name="title">The title.</param> /// <param name="listBoxItems">The list box items.</param> /// <param name="mustSelectCountIN">The must select count in.</param> /// <returns></returns> public static List<string> ShowDialog(string labelText, string title, List<SelectItemFromListBox.SelectItem> listBoxItems, int mustSelectCountIN = -1) { var s = new SelectItemsFromCheckBox(); s.mustSelectCount = mustSelectCountIN; s.Text = title; s.label1.Text = labelText; s.checkedListBox1.Items.Clear(); var a = 0; foreach (var v in listBoxItems) { s.checkedListBox1.Items.Add(v.Text); s.checkedListBox1.SetSelected(a, v.Preselected); a++; } s.ShowDialog(); return s.returnvalues; }
/// <summary> /// Shows the dialog. /// </summary> /// <param name="labelText">The label text.</param> /// <param name="title">The title.</param> /// <param name="listBoxItems">The list box items.</param> /// <param name="mustSelectCountIN">The must select count in.</param> /// <returns></returns> public static List <string> ShowDialog(string labelText, string title, List <SelectItemFromListBox.SelectItem> listBoxItems, int mustSelectCountIN = -1) { var s = new SelectItemsFromCheckBox(); s.mustSelectCount = mustSelectCountIN; s.Text = title; s.label1.Text = labelText; s.checkedListBox1.Items.Clear(); var a = 0; foreach (var v in listBoxItems) { s.checkedListBox1.Items.Add(v.Text); s.checkedListBox1.SetSelected(a, v.Preselected); a++; } s.ShowDialog(); return(s.returnvalues); }