RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolBar.OnCustomDraw Event

Occurs when the toolbar must be painted.

Pascal
property OnCustomDraw: TTBCustomDrawEvent;
C++
__property TTBCustomDrawEvent OnCustomDraw;

Write an OnCustomDraw event handler to enhance or replace the automatic painting of the toolbar. Use the toolbar's Canvas property to render the toolbar's image. OnCustomDraw is for painting the background of the toolbar. The painting of individual buttons on the toolbar should be handled in an OnCustomDrawButton or OnAdvancedCustomDrawButton event handler. 

Sender is the toolbar that needs to be painted. 

ARect indicates the dimensions of the toolbar on the canvas. 

Leave DefaultDraw as true if the toolbar should continue with the normal painting process. Set DefaultDraw to false if the OnCustomDraw event handler has completely painted the toolbar.

Note: OnCustomDraw only occurs prior to painting the toolbar's background. To respond at other points in the paint process (when the background is erased, or after the default painting of the toolbar's background), use OnAdvancedCustomDraw instead.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!