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

# TCustomForm

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

TCustomForm - the base type for TForm

## Declaration

Source position: forms.pp line 407

`type TCustomForm = class(TScrollingWinControl)`
`protected`
`FActionLists: TList;` |  | FActionLists - local variable holding lists of actions asociated with the Form
`FFormBorderStyle: TFormBorderStyle;` |  | FFormBorderStyle - local variable to hold style of border
`FFormState: TFormState;` |  |
`protected`
`class procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`protected`
`procedure CMShowingChanged(); message;` |  | CMShowingChanged - system message method for showing if the form has changed
`procedure DoShowWindow; virtual;` |  | DoShowWindow automatically choose a control to focus
`procedure Activate; virtual;` |  | Activate - method for rendering the Form active
`procedure ActiveChanged; virtual;` |  | ActiveChanged - method for a form that is active and changed
`procedure AdjustClientRect(); override;` |  | AdjustClientRect - adjusts window size to accommodate borders
`procedure BeginFormUpdate;` |  | BeginFormUpdate - start updating the Form
`function ColorIsStored; override;` |  | Returns True if Colour is stored
`procedure CreateParams(); override;` |  | CreateParams calls inherited CreateParams, and specifically copies style from parent
`procedure CreateWnd; override;` |  | CreateWnd calls inherited CreateWnd, signals if a handle is required and attaches a menu to the window if one does not yet exist; activates focus if visible
`procedure Deactivate; virtual;` |  | Deactivate - method for rendering the Form inactive
`procedure DoClose(); virtual;` |  | DoClose - close the Form using the specified CloseAction
`procedure DoCreate; virtual;` |  | DoCreate - perform the Create action
`procedure DoDestroy; virtual;` |  | DoDestroy- perform the Destroy action
`procedure DoHide; virtual;` |  | DoHide - method for hiding a previously visible object
`procedure DoShow; virtual;` |  | DoShow - method to redender visible a previously hidden form
`procedure EndFormUpdate;` |  | EndFormUpdate - finish updating the Form
`procedure GetChildren(); override;` |  | GetChildren calls inherited GetChildren then takes ownership of all components, including those without parents
`function HandleCreateException; virtual;`
`function HandleDestroyException; virtual;`
`function HandleShowHideException; virtual;`
`procedure InitializeWnd; override;`
`procedure Loaded; override;` |  | Loaded - calls inherited Loaded, makes this the active control and gives it focus
`procedure ChildHandlesCreated; override;` |  | ChildHandlesCreated - method for use when handles have been created for descendants
`procedure Notification(); override;` |  | Notification calls inherited Notification then add or removes the component's action list (depending on what Operation specifies)
`procedure PaintWindow(); override;` |  | Paint handler plug-in
`procedure RequestAlign; override;` |  | Smart calling Parent.AlignControls
`procedure CalculatePreferredSize(); override;`
`procedure SetZOrder(); override;` |  | SetZOrder - set the Z order for the Form; if Topmost is True, Form is on top of all other objects
`procedure SetParent(); override;` |  | Find who the parents are and store the information
`procedure MoveToDefaultPosition; virtual;`
`procedure UpdateShowing; override;` |  | UpdateShowing - method to update the Visible property
`procedure SetVisible(); override;` |  | Procedure to set Visible flag and ensure the control can be seen
`procedure AllAutoSized; override;`
`procedure DoFirstShow; virtual;` |  | DoFirstShow - perform the first Show action since creation of the Form
`procedure UpdateWindowState;` |  | UpdateWindowState - update the state of the Window displaying the Form
`procedure VisibleChanging; override;` |  | VisibleChanging - method for dealing with a Form whose Visible property is changing
`procedure VisibleChanged; override;`
`procedure WndProc(); override;` |  | WndProc - performs actions specific to the message then calls inherited WndProc
`function VisibleIsStored;` |  | VisibleIsStored - True if the Visible property has been stored
`procedure DoSendBoundsToInterface; override;` |  | DoSendBoundsToInterface - sends information about the control's bounds to the interface
`procedure DoAutoSize; override;` |  | DoAutoSize - method for actually performing the AutoSize
`procedure SetAutoSize(); override;` |  | Set the boolean variable that determines whether autosize can function
`procedure SetAutoScroll(); override;`
`procedure DoAddActionList();`
`procedure DoRemoveActionList();`
`procedure BeginAutoDrag; override;`
`procedure DoDock(); override;` |  | Adjust the control's position and extent for the new docksite.
`function GetFloating; override;` |  | Guess whether the control is floating.
`function GetDefaultDockCaption; override;` |  | GetDefaultDockCaption - returns the default caption to be used for docking
`procedure CMActionExecute(); message;` |  | CMActionExecute - system message method for executing action
`procedure CMActionUpdate(); message;` |  | CMActionUpdate - system message method for updating action
`function DoExecuteAction();` |  | Asks every visible control to Execute the specified action ExeAction.
`function DoUpdateAction();` |  | DoUpdateAction - asks all visible controls to update the specified action
`procedure UpdateActions; virtual;` |  | UpdateActions - method for updating actions
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomForm: checks for correct ClassType, looks for required resources then creates the Form
`constructor CreateNew(); virtual;` |  | CreateNew - constructor for creating a completely new form
`destructor Destroy; override;` |  | Destroy - destructor for TCustomForm: frees all menus, icons, actionlists, screens and handlers, then performs inherited Destroy
`procedure AfterConstruction; override;`
`procedure BeforeDestruction; override;` |  | BeforeDestruction - method to be applied before Form is destroyed (usually involves clean-up)
`public`
`class function GetControlClassDefaultSize; override;` |  | Find the default size for this class of controls (by reference to parents)
`public`
`function BigIconHandle;` |  | BigIconHandle - returns system Handle for large Icon
`procedure Close;`
`function CloseQuery; virtual;` |  | Is the associated query to be closed?
`procedure DefocusControl();` |  | DefocusControl - withdraws focus from the specified control, removing it if required
`procedure DestroyWnd; override;` |  | DestroyWnd - destroy the window for this control
`procedure EnsureVisible();` |  | Ensure that this form is always visible, if necessary moving it to the top (front) of the stack of images
`procedure FocusControl();` |  | FocusControl - giving focus to specified control, automatically bringing form to front
`function FormIsUpdating; override;` |  | True if the form is being updated
`function GetFormImage;` |  | GetFormImage - gets a Bitmap image for the Form
`function GetRolesForControl();` |  | GetRolesForControl - returns a set of roles (default, cancel) for the Form
`procedure Hide;` |  | Hide this control
`procedure IntfDropFiles();` |  | IntfDropFiles - Invokes OnDropFilesEvent of the form. This function is called by the interface.
`procedure IntfHelp();` |  | IntfHelp - Show help for control or menu item. This function is called by the interface.
`function IsShortcut(); virtual;` |  | IsShortcut - if True, the specified Key and Message are active as a shortcut
`procedure MakeFullyVisible();`
`function AutoSizeCheckParent; override;`
`procedure GetPreferredSize(); override;`
`procedure Release;` |  | Set free the resources of the form
`function CanFocus; override;`
`procedure SetFocus; override;`
`function SetFocusedControl(); virtual;` |  | SetFocusedControl - method for giving focus to specified control; returns True if successful
`procedure SetRestoredBounds();` |  | SetRestoredBounds - set the bounds defining the position of the restored control
`procedure Show;` |  | Makes the control visible.
`function ShowModal; virtual;` |  | Show this form as modal - ie control cannot be resumed by another form until the current form is closed
`procedure ShowOnTop;` |  | Shows this form as the top (nearest) item of any stack of windows or images.
`function SmallIconHandle;` |  | SmallIconHandle - returns system Handle for small Icon
`function WantChildKey(); virtual;` |  | WantChildKey - returns True if the specified child control requires a key (Message)
`procedure RemoveAllHandlersOfObject(); override;` |  | RemoveAllHandlersOfObject - method for removing all of an object's handlers: part of a clean-up procedure
`procedure AddHandlerFirstShow();` |  | AddHandlerFirstShow - perform the action for adding a handler at the time of first showing
`procedure RemoveHandlerFirstShow();` |  | RemoveHandlerFirstShow - perform the action for removing the handler on the first showing
`procedure AddHandlerClose();` |  | AddHandlerClose - adds a handler for closing Form
`procedure RemoveHandlerClose();` |  | RemoveHandlerClose - removes handler for closing form
`procedure AddHandlerCreate();` |  | AddHandlerCreate - performs the OnCreateHandler event
`procedure RemoveHandlerCreate();` |  | RemoveHandlerCreate - removes the handler for the Create event
`procedure Dock(); override;` |  | Move the control into a new docksite.
`procedure UpdateDockCaption(); override;`
`property Active: Boolean; [r]` |  | Is true when the form has the focus
`property ActiveControl: TWinControl; [rw]` |  | Specifies the active control on the form
`property ActiveDefaultControl: TControl; [rw]` |  | Specifies the active default control on the Form
`property AllowDropFiles: Boolean; [rw]` |  | Specifies if files are allowed to be dropped on this form.
`property AlphaBlend: Boolean; [rw]`
`property AlphaBlendValue: Byte; [rw]`
`property AutoScroll; [s]`
`property BorderIcons: TBorderIcons; [rw]` |  | Specifies which icons appear on the top of the form
`property BorderStyle: TFormBorderStyle; [rw]` |  | The border style for this Form
`property CancelControl: TControl; [rw]` |  | The control associated with the cancel action
`property Caption; [s]` |  | Caption - the text-string appearing on the Control, usually used to identify its function
`property Color;` |  | Determine the colour for the current control
`property DefaultControl: TControl; [rw]` |  | The control associated with the default action for this form
`property DefaultMonitor: TDefaultMonitor; [rw]`
`property Designer: TIDesigner; [rw]` |  |
`property FormState: TFormState; [r]` |  | Determines the state of the form
`property FormStyle: TFormStyle; [rw]` |  | Determinates the style of the form
`property HelpFile: String; [rw]` |  | Specifies the help file that is used by the form
`property Icon: TIcon; [rws]` |  | The Icon associated with this Form (which may appear in menus, directories, ListBoxes etc)
`property KeyPreview: Boolean; [rw]` |  | KeyPreview - if True, Key Preview is possible
`property Menu: TMainMenu; [rw]` |  | Specifies a MainMenu for this form
`property ModalResult: TModalResult; [rw]` |  | Specifies the return value of an modal form
`property Monitor: TMonitor; [r]` |  | Monitor - returns the monitor on which the form is mostly places (the biggest form area is placed)
`property PopupMode: TPopupMode; [rw]`
`property PopupParent: TCustomForm; [rw]`
`property OnActivate: TNotifyEvent; [rw]` |  | Event handler for activation (opening) of the form
`property OnClose: TCloseEvent; [rws]` |  | Event handler for closing the form
`property OnCloseQuery: TCloseQueryEvent; [rws]` |  | Event handler for closing the query associated with the form
`property OnCreate: TNotifyEvent; [rw]` |  | Event handler for creating the form
`property OnDeactivate: TNotifyEvent; [rw]` |  | Event handler for deactivating the form
`property OnDestroy: TNotifyEvent; [rw]` |  | Event handler when the form is being destroyed
`property OnDropFiles: TDropFilesEvent; [rw]` |  | The event invoked when file is dropped on this form.
`property OnHelp: THelpEvent; [rw]` |  | Event handler when Help is required
`property OnHide: TNotifyEvent; [rw]` |  | Event handler if form is being hidden
`property OnResize; [s]` |  | Event Handler for resize of control
`property OnShortcut: TShortCutEvent; [rw]` |  | Event handler if shortcut key is pressed
`property OnShow: TNotifyEvent; [rw]` |  | Event handler if form is to be shown
`property OnWindowStateChange: TNotifyEvent; [rw]` |  | Event handler for a change in the window state
`property ParentFont;` |  | ParentFont - should the control use the same font as the parent? Default is true
`property PixelsPerInch: LongInt; [rws]` |  | The scaling of the form in absolute terms
`property Position: TPosition; [rw]` |  | The position of the form on the screen
`property RestoredLeft: Integer; [r]` |  | The position of the left edge of the form when it is restored (ie changes from minimised or maximised)
`property RestoredTop: Integer; [r]` |  | The position of the top edge of the form when it is restored (ie changes from minimised or maximised)
`property RestoredWidth: Integer; [r]` |  | The width of the form when it is restored (ie changes from minimised or maximised)
`property RestoredHeight: Integer; [r]` |  | The height of the form when it is restored (ie changes from minimised or maximised)
`property ShowInTaskBar: TShowInTaskbar; [rw]` |  | Should the form be shown in the system Task Bar?
`property Visible; [s]` |  | Visible - can the control be seen?
`property WindowState: TWindowState; [rw]` |  | Represents how the form appears on the screen
`end;`

## Inheritance

`TCustomForm` |  | TCustomForm - the base type for TForm
`TScrollingWinControl` |  | TScrollingWinControl - a class of Window Control that has one or more scroll bars
`TCustomControl` |  | TCustomControl - a base class for many window controls
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

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