private void RefreshMdiWindowList() { RibbonItemCollection items = switchWindowsToggleGroup.Items; for (int i = 0; i < items.Count; i++) { items[i].Dispose(); } items.Clear(); Form[] forms = MdiChildren; Form activeChild = ActiveMdiChild; for (int i = 0; i < forms.Length; i++) { frmList f = forms[i] as frmList; if (f != null && !f.BeingDisposed) { RibbonToggleButton tb = new RibbonToggleButton(); tb.Pressed = object.ReferenceEquals(f, activeChild); tb.Text = f.Text; tb.Tag = f; items.Add(tb); } } switchWindowsMenu.Enabled = items.Count > 0; }
private void ShowPrintListDialog() { frmList frmList = new frmList(); frmList.ShowDialog(this); int num = 1; frmList.Dispose(); }