[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomButton

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomButton - the base class for TButton and TBitBtn

## Declaration

Source position: stdctrls.pp line 1062

`type TCustomButton = class(TButtonControl)`
`protected`
`procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`procedure Click; override;` |  | Click - checks if the parent form has a Modal Result, then calls inherited method
`procedure CreateWnd; override;` |  | CreateWnd calls inherited method and sets default Widget Set
`procedure ControlKeyDown(); override;` |  | ControlKeyDown - contains the set of special keys (shift, control, alt, meta) that are pressed
`procedure ControlKeyUp(); override;` |  | ControlKeyUp - contains the set of special keys (shift, control, alt, meta) that are not pressed ('up')
`function DialogChar(); override;` |  | DialogChar - a LCL Key Message; returns True if a Dialog character has an associated message
`function ChildClassAllowed(); override;` |  | ChildClassAllowed - returns True if the given child class is permitted
`function GetControlClassDefaultSize; override;` |  | GetControlClassDefaultSize returns its own defaults, overriding the inherited values
`property ParentColor;` |  | ParentColor - should the control have the same colour as the parent? Default is true
`procedure WSSetDefault;` |  | WSSetDefault - writes the default widget set to local variable
`procedure WSSetText(); override;` |  | WSSetText - writes the text name of the widget set to a local variable
`procedure TextChanged; override;` |  | Procedure to deal with changes in text
`procedure Loaded; override;` |  | Loaded calls inherited method, checks to see whether it is a default or cancel control, sets the default widget set
`procedure UpdateDefaultCancel;`
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomButton: calls inherited Create then initialises style, colour, bounds, alignment and various other properties
`procedure ExecuteDefaultAction; override;` |  | ExecuteDefaultAction if the control is active or default, executes the Click action
`procedure ExecuteCancelAction; override;` |  | ExecuteCancelAction if this is a Cancel button, executes the Click action
`procedure ActiveDefaultControlChanged(); override;` |  | The active default control has changed to NewControl
`procedure UpdateRolesForForm; override;` |  | Update the roles for this form; see whether there have been any changes in its role
`function UseRightToLeftAlignment; override;` |  | UseRightToLeftAlignment - as opposed to usual left to right
`property Active: Boolean; [rs]` |  | Is this control Active - has it got Focus; is the mouse over it?
`property Default: Boolean; [rw]` |  | Is this the Default button? (default setting is False)
`property ModalResult: TModalResult; [rw]` |  | Determines whether the button closes its modal parent form.
`property Cancel: Boolean; [rw]` |  | Is this the Cancel button? (default setting is False)
`property Color;` |  | Determine the colour for the current control
`property TabStop;` |  | Is the control in the sequence of controls accessed by successive presses of the Tab key?
`end;`

## Inheritance

`TCustomButton` |  | TCustomButton - the base class for TButton and TBitBtn
`TButtonControl` |  | TButtonControl : ancestor class for several Button (including Radio Button) and Check Box classes
`TWinControl` |  | TWinControl - the base class for all windowed controls
`TControl` |  | TControl - the main ancestor class for visual controls.
`TLCLComponent`
?
`TObject`

The latest version of this document can be found at lazarus-ccr.sourceforge.net.