How to: Access the Navigation Dock Panel (in a WinForms Application)

  • 2 minutes to read

This topic describes how to access and customize the Dock Panel used to display Navigation in WinForms applications.


A complete sample project is available in the DevExpress Code Examples database at

The snippet below demonstrates these steps.

using System.Windows.Forms;
using DevExpress.ExpressApp;
// ...
public class HideNavigationPanelButtonsController : WindowController {
    public HideNavigationPanelButtonsController() {
        this.TargetWindowType = WindowType.Main;
    protected override void OnActivated() {
        Frame.TemplateChanged += Frame_TemplateChanged;
    private void Frame_TemplateChanged(object sender, EventArgs e) {
        Form form = (Form)Frame.Template;
        form.Load += Form_Load;
    private void Form_Load(object sender, EventArgs e) {
        if(Frame.Template is DevExpress.ExpressApp.Win.Templates.INavigationPanelHolder) {
            DevExpress.XtraBars.Docking.DockPanel navigationPanel = 
            navigationPanel.Options.ShowAutoHideButton = false;
            navigationPanel.Options.ShowCloseButton = false;
    protected override void OnDeactivated() {
        Frame.TemplateChanged -= Frame_TemplateChanged;

In the code above, the BaseDockOptions.ShowAutoHideButton and BaseDockOptions.ShowCloseButton options are changed. You can use other properties of the DockPanelOptions as well.


You can access the DockPanel object directly in the TemplateChanged event handler, but your settings will be overriden by XAF defaults in this instance. So, use the Form.Loadevent to override defaults.