Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Collapse]Build an Application
  [Collapse]Choose Application UI
   [Collapse]Office Inspired UI
     How to: Build an Office-inspired UI manually
     How to: Build an Office-inspired UI using DevExpress Template Gallery
   [Expand]Visual Studio Inspired UI
   [Expand]Windows Modern UI
    Touch-Enabled Tile UI
   Data Management Controls
  [Expand]Printing and Exporting
  [Expand]WinForms MVVM
  [Expand]Skins
  [Expand]Localization
  [Expand]Right-to-Left Layout
   Redistribution and Deployment
 [Expand]Controls and Libraries
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Build an Office-inspired UI manually

This tutorial demonstrates how to build a typical Office Inspired UI shown below. Note that you can also use the Template Gallery to build the same UI type.

  1. In Visual Studio, go to "File | New | Project" or press CTRL+SHIFT+N to create a new project. Select the default Visual Studio "Windows Forms Application" template and click OK.

  2. Use the Visual Studio Toolbox to add Navigation Frame, Navigation Bar and Office Navigation Bar controls to your form.

  3. Arrange the controls as illustrated below.

  4. Use the Navigation Bar smart tag to switch the bar to the Navigation Pane View.

  5. Change captions for automatically created NavBarGroup and NavigationPage controls to "Employees" and "Customers". Assign the same text strings to the Tag property of both pages, as demonstrated in the code below.

  6. Click the Navigation Frame's chevron buttons to select different pages and drop a LabelControl on each page, then customize label captions. At runtime, these labels will allow you to identify Navigation Frame pages.

  7. Use the Office Navigation Bar smart tag to remove automatically generated "Item1" and "Item2" elements.

  8. Assign the Navigation Bar to the OfficeNavigationBar.NavigationClient property to bind both controls together. You will notice that the bar now has "Employees" and "Customers" elements based on existing Navigation Bar groups. Launch the app and click an element to see that the corresponding group is activated.

  9. Handle the NavBarControl.ActiveGroupChanged event to switch the selected Frame page. The code below uses page tags to find the required page.
    Tip

    Review the Responding to User Clicks at Runtime article to learn about other ways to implement navigation using Navigation Bar.

  10. Test your application at runtime. Note that, by default, animation effects are enabled.

  11. Return to design time, invoke the form smart tag (you may need to rebuild the project and reload the form to see it) and click "Convert to Ribbon Form". This will convert your main form to a Ribbon Form, which will add Ribbon and Ribbon Status Bar controls.

  12. Add a BarSubItem with two child BarButtonItems to the Ribbon Page Group. End-users will be able to toggle between "Employees" and "Customers" Navigation Frame pages by clicking these buttons.

  13. At design time, double-click the first button to create a BarItem.ItemClick event handler. The code sample below illustrates how to switch active Navigation Bar groups. Coupled with the previously handled NavBarControl.ActiveGroupChanged event, this button also changes Navigation Frame pages.
  14. Select the second BarButtonItem and locate the ItemClick event in the Visual Studio Properties window. Use the combo box to choose the same event handler as for the first button, so that both sub-menu items are functional. Launch the application and make sure the Navigation Frame changes its pages correctly.

Expanded See Also

How would you rate this topic?​​​​​​​