RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolBar.OnAdvancedCustomDrawButton Event

Occurs at discrete stages during the painting of the toolbar's buttons.

Pascal
property OnAdvancedCustomDrawButton: TTBAdvancedCustomDrawBtnEvent;
C++
__property TTBAdvancedCustomDrawBtnEvent OnAdvancedCustomDrawButton;

Write an OnAdvancedCustomDrawButton event handler to enhance or replace the automatic painting of the toolbar's buttons. Use the toolbar's Canvas property to render the button's image. OnAdvancedCustomDrawButton occurs during the erasure and painting of individual buttons on the toolbar. The painting of the toolbar itself should be handled in an OnCustomDraw or OnAdvancedCustomDraw event handler. 

Sender is the toolbar that contains the button. 

Button is the button that needs to be painted. Use its properties to determine what to paint and where the button sits on the toolbar's canvas. 

State provides information that you may want to visually represent when painting the button. 

Stage indicates the current stage of the drawing process. 

Flags is used only when Stage is cdPrePaint. It influences how the button is subsequently rendered by the default drawing process. Return the set of flags that indicate how you want the tool button to be drawn. 

DefaultDraw is used only when Stage is cdPrePaint. Leave DefaultDraw as true if the button should be painted using the normal process after the event handler exists. Set DefaultDraw to false if the OnAdvancedCustomDrawButton event handler has completely painted the tool button.

Note: OnAdvancedCustomDrawButton occurs at several points during the painting of the toolbar's buttons. If you only need to respond immediately prior to the default painting of each button and are not using the Flags parameter, use OnCustomDrawButton instead.
 

 

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