安装devexpress支持:
DevExpress 21.2.6
默认状态设置为最大化。
设置ribbon属性:
/// <summary>
/// 设置Ribbon属性
/// </summary>
/// <param name="ribbon"></param>
private void SetRibbon(RibbonControl ribbon)
{
ribbon.ShowToolbarCustomizeItem = false; //显示自定义工具栏
ribbon.ShowSearchItem = false; //显示搜索按钮
//ribbon.ShowMoreCommandsButton = DevExpress.Utils.DefaultBoolean.True; //显示更多命令按钮,
ribbon.ShowExpandCollapseButton = DevExpress.Utils.DefaultBoolean.False; //显示下拉按钮
ribbon.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; //显示应用按钮
ribbon.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; //显示设置按钮
}
效果如下:
添加导航菜单:
添加导航组件:NavBarControl
添加菜单:
效果如下:
添加dockmanager:
拖入pannel中,dock选择fill填充:
效果如下:
修改pannel名称:
设置左边pannel属性:
/// <summary>
/// 设置DockPanel属性
/// </summary>
/// <param name="dockPanel"></param>
public void SetDockPannel(DockPanel dockPanel)
{
dockPanel.Options.ShowCloseButton = false;
dockPanel.Options.ShowMaximizeButton = false;
dockPanel.Options.ShowMinimizeButton = false;
dockPanel.Options.AllowDockBottom = false;
dockPanel.Options.AllowDockFill = false;
dockPanel.Options.AllowDockRight = false;
dockPanel.Options.AllowDockTop = false;
dockPanel.Options.AllowFloating = false;
dockPanel.Options.FloatOnDblClick = false;
}
设置dockeMangaer:
/// <summary>
/// 设置DockManager属性
/// </summary>
/// <param name="dockManager"></param>
public void SetDockManager(DockManager dockManager)
{
dockManager.AutoHiddenPanelShowMode = AutoHiddenPanelShowMode.MouseClick;
}