windowsforms-4913-controls-and-libraries-navigation-controls-navigation-bar-appearance-navigation-bar-custom-painting-specifics.md
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:
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.
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.
See Also
How to get colors that correspond to the currently used skin
How to obtain the color of a particular control's element when skins are used