RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolBar.CustomDrawButton Method
Pascal
function CustomDrawButton(Button: TToolButton; State: TCustomDrawState; Stage: TCustomDrawStage; var Flags: TTBCustomDrawFlags): Boolean; virtual;
C++
virtual __fastcall Boolean CustomDrawButton(TToolButton Button, TCustomDrawState State, TCustomDrawStage Stage, TTBCustomDrawFlags Flags);

CustomDrawButton is called automatically at discrete stages during the drawing process to generate the OnCustomDrawButton and OnAdvancedCustomDrawButton events. 

Button specifies the tool button that needs to be drawn. 

State describes the state of the button, so that the event handler can reflect that state in the button's image. 

Stage indicates the current stage of the paint process. When Stage is cdPrePaint, CustomDrawButton generates an OnCustomDrawButton event followed by an OnAdvancedCustomDrawButton event. At all other stages, CustomDrawButton generates only the OnAdvancedCustomDrawButton event. 

Flags is used only when Stage is cdPrePaint. It influences how the button is subsequently rendered by the default drawing process. CustomDrawButton returns the set of flags that indicates how the toolbar should proceed with rendering the button. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!