搞定了!(-_-)
将父窗体中的
MdiMergeStyle属性修改为Always,从而引发Merge和UnMerge事件,
在Merge事件中添加parentRRibbon.MergeRibbon(childRibbon);代码,在UnMerge事件中添加parentRRibbon.UnMergeRibbon();代码。
完整代码如下:
[C#] 纯文本查看 复制代码 private void rbMain_Merge(object sender, DevExpress.XtraBars.Ribbon.RibbonMergeEventArgs e)
{
RibbonControl parentRRibbon = sender as RibbonControl;
RibbonControl childRibbon = e.MergedChild;
parentRRibbon.StatusBar.MergeStatusBar(childRibbon.StatusBar);
parentRRibbon.MergeRibbon(childRibbon);
}
private void rbMain_UnMerge(object sender, RibbonMergeEventArgs e)
{
RibbonControl parentRRibbon = sender as RibbonControl;
parentRRibbon.StatusBar.UnMergeStatusBar();
parentRRibbon.UnMergeRibbon();
} |