[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Collapse]Navigation Controls
   [Collapse]Navigation Bar
      Navigation Bar Appearance Specifics
      Navigation Bar Look And Feel Specifics
      Navigation Bar Custom Painting Specifics
     Save and Restore Layout
    [Expand]Member Tables
     NavBarControl to AccondionControl Converter
   [Expand]Accordion Control
    Navigation Frame and Tab Pane
    Navigation Pane
    Tile Bar
   [Expand]TileNav Pane
    WindowsUI Button Panel
   [Expand]Office Navigation Bar
   [Expand]Tile Control
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [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]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Navigation Bar Custom Painting Specifics

Custom drawing provides specially designed events, allowing you to take full control over the painting process. The custom draw events are raised every time the corresponding elements need to be painted. An event handler receives an object whose properties specify an element's bounds, the appearance settings used to paint the element and the view information specific to the painted element.

There are two main scenarios for using custom draw events:

  • Performing complete element painting

    You can perform the overall painting of an element using the drawing methods of a Graphics object.

  • Customizing the display information of elements

    In this instance, you don't need to render the entire element yourself, instead you can simply change the information (appearance, contents, bounds) used to draw it. The element will then be painted after the event handler has been executed.

Expanded Performing complete element painting

Custom draw events allow you to perform complete painting of the NavBar's elements. An event's CustomDrawObjectEventArgs.Graphics parameter represents the graphic surface, and this provides the drawing methods, used to render the control's elements. To prevent the element's default painting from being performed set the event's CustomDrawObjectEventArgs.Handled parameter to true. This indicates that the event was handled and that no default actions are required. If this property is set to false, the element will be painted using the default drawing mechanism after the event handler has been executed.

Expanded Customizing the display information of elements

Using custom draw events, you can customize an element's display information, and then invoke the default painting procedure. This allows the element's appearance to be controlled dynamically. The event's CustomDrawObjectEventArgs.Handled parameter must be left set to false. The element will be painted using the specified information, after your event is handled.

Expanded See Also

Is this topic helpful?​​​​​​​