private void ribbonControl1_CanMinimizePageGroup(object sender, CanMinimizePageGroupEventArgs e) { if (e.PageGroup.Tag == null) { return; } int groupMinimizeIndex = GetGroupMinimizeIndex(e.PageGroup); if (groupMinimizeIndex == -1) { e.CanMinimize = false; return; } for (int i = 0; i < e.PanelViewInfo.Groups.Count; i++) { RibbonPageGroupViewInfo groupViewInfo = e.PanelViewInfo.Groups[i]; int minimizeIndex = GetGroupMinimizeIndex(groupViewInfo.PageGroup); if (minimizeIndex > 0 && minimizeIndex < groupMinimizeIndex) { if (!groupViewInfo.Minimized) { e.CanMinimize = false; return; } } } }
internal bool RaiseCanMinimizePageGroup(RibbonPageGroup group, RibbonPanelViewInfo panelViewInfo) { CanMinimizePageGroupEventArgs args = new CanMinimizePageGroupEventArgs(true, group, panelViewInfo); if (CanMinimizePageGroup != null) { CanMinimizePageGroup(this, args); } return(args.CanMinimize); }