windowsforms-devexpress-dot-xtrabars-dot-ribbon-3041643c.md
Lists values that specify the alignment of the side navigation relative to the Ribbon Form’s title.
Namespace : DevExpress.XtraBars.Ribbon
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public enum RibbonFormNavigationControlLayoutMode
Public Enum RibbonFormNavigationControlLayoutMode
| Name | Description |
|---|---|
Default |
The navigation control stretches from the top to the bottom of the form (full height).
|
| StretchToTop |
The navigation control stretches from the top to the bottom of the form (full height).
|
| StretchToFormTitle |
The navigation control starts below the form’s title and extends to the bottom of the form.
|
The following properties accept/return RibbonFormNavigationControlLayoutMode values:
Use the NavigationControlLayoutMode property to align the side navigation relative to the Ribbon Form’s title.
The following code snippet creates a side navigation inspired by the new Microsoft Outlook:
using DevExpress.XtraBars.Navigation;
using DevExpress.XtraBars.Ribbon;
using System.Windows.Forms;
namespace DXApplication {
public partial class Form1 : RibbonForm {
AccordionControl accordion;
public Form1() {
InitializeComponent();
accordion = new AccordionControl() { Dock = DockStyle.Left };
this.Controls.Add(accordion);
this.NavigationControl = accordion;
this.NavigationControlLayoutMode = RibbonFormNavigationControlLayoutMode.StretchToFormTitle;
CreateAccordionItems();
}
void CreateAccordionItems() {
AccordionControlElement group1 = new AccordionControlElement(ElementStyle.Group) {
Name = "group1",
Text = "Contacts",
Expanded = true
};
AccordionControlElement item1 = new AccordionControlElement(ElementStyle.Item) {
Name = "itemCustomers",
Text = "Customers",
};
AccordionControlElement item2 = new AccordionControlElement(ElementStyle.Item) {
Name = "itemEmployees",
Text = "Employees"
};
group1.Elements.AddRange(new AccordionControlElement[] { item1, item2 });
accordion.Elements.Add(group1);
}
}
}
Imports DevExpress.XtraBars.Navigation
Imports DevExpress.XtraBars.Ribbon
Imports System.Windows.Forms
Namespace DXApplication
Public Partial Class Form1
Inherits RibbonForm
Private accordion As AccordionControl
Public Sub New()
InitializeComponent()
accordion = New AccordionControl() With {.Dock = DockStyle.Left}
Me.Controls.Add(accordion)
Me.NavigationControl = accordion
Me.NavigationControlLayoutMode = RibbonFormNavigationControlLayoutMode.StretchToFormTitle
CreateAccordionItems()
End Sub
Private Sub CreateAccordionItems()
Dim group1 As New AccordionControlElement(ElementStyle.Group) With {
.Name = "group1",
.Text = "Contacts",
.Expanded = True
}
Dim item1 As New AccordionControlElement(ElementStyle.Item) With {
.Name = "itemCustomers",
.Text = "Customers"
}
Dim item2 As New AccordionControlElement(ElementStyle.Item) With {
.Name = "itemEmployees",
.Text = "Employees"
}
group1.Elements.AddRange(New AccordionControlElement() {item1, item2})
accordion.Elements.Add(group1)
End Sub
End Class
End Namespace
See Also