0

我有带 3 个按钮的功能区表单。我想将选项卡式子表单更改为垂直、水平或级联...有什么办法吗?

如果使用带有属性的 frmmain

ismdiContainer=true

private void btn1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
     form1 frm1 = new form1();
     frm1.MdiParent=this;
     frm1.Show();
}

private void btnVertical_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
     LayoutMdi(MdiLayout.TileVertical);
}

private void btnHorizontal_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
     LayoutMdi(MdiLayout.TileHorizontal);
}

private void btnCascade_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
     LayoutMdi(MdiLayout.Cascade);
}

问题是,当我按 btnVertical 更改布局时如何更改布局

4

1 回答 1

0

要使该LayoutMdi方法起作用,只需从表单中删除 XtraTabbedMdiManager 或取消XtraTabbedMdiManager.MdiParent属性,因为 MdiLayout 模式不适用于 XtraTabbedMdiManager 的选项卡:

void btnVertical_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
     xtraTabbedMdiManager1.MdiParent = null; // turn off tabs
     LayoutMdi(MdiLayout.TileVertical);
}

作为替代解决方案,您可以尝试使用DocumentManager组件及其Native MDI View

于 2017-07-26T15:46:54.750 回答