Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Collapse]Navigation Controls
   [Collapse]Navigation Bar
     Views
    [Collapse]Appearance
      Navigation Bar Appearance Specifics
      Navigation Bar Look And Feel Specifics
      Navigation Bar Custom Painting Specifics
     Save and Restore Layout
    [Expand]Examples
    [Expand]Member Tables
   [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]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET 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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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:

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

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