public void Show(string settings, Point p, Size s, Form parent, Object tag = null, bool applytheme = true) { if (cc == null) { cc = new ExtendedControls.CheckedIconListBoxForm(); foreach (var x in groupoptions) { cc.AddItem(x.Tag, x.Text, x.Image); } foreach (var x in standardoptions) { cc.AddItem(x.Tag, x.Text, x.Image); } string[] slist = settings.SplitNoEmptyStartFinish(';'); if (slist.Length == 1 && slist[0].Equals("All")) { cc.SetCheckedFromToEnd(groupoptions.Count()); } else { cc.SetChecked(settings); } SetGroupOptions(); cc.FormClosed += FormClosed; cc.CheckedChanged += checkboxchanged; if (s.Height < 1) { s.Height = cc.HeightNeeded(); } cc.PositionSize(p, s); cc.LargeChange = cc.ItemCount * Properties.Resources.All.Height / 40; // 40 ish scroll movements cc.CloseOnDeactivate = CloseOnDeactivate; if (applytheme) { ThemeableFormsInstance.Instance?.ApplyToControls(cc, applytothis: true); } tagback = tag; cc.Show(parent); } else { cc.Close(); } }
private void FormClosed(Object sender, FormClosedEventArgs e) { Closing?.Invoke(cc.GetChecked(groupoptions.Count, AllOrNoneBack), tagback); cc = null; }