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

TForm

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

Implements a form used in an LCL application.

Declaration

Source position: forms.pp line 839

type TForm = class(TCustomForm)

protected

  class procedure WSRegisterClass; override;

  

Creates an association between the class type and its widgetset class.

  procedure CreateWnd; override;

  

Creates the handle for the widgetset class and updates it menu and icons.

  procedure Loaded; override;

  

Performs actions when LCL component streaming has been completed for the form instance.

public

  constructor Create(); override;

  

Constructor for the class instance.

  procedure Cascade;

  

Arranges MDI child forms so they overlap.

  procedure Next;

  

Activates the next child MDI form (fsMDIChild) in the form sequence.

  procedure Previous;

  

Activates the previous MDI child form in the form sequence.

  procedure Tile;

  

Arranges MDI child forms side-by-side in a grid format.

  procedure ArrangeIcons;

  

Arranges the icons for minimized forms in a MDI form.

  property ClientHandle: HWND;

  

The Handle of the MDIForm client (container for MDI children).

  property DockManager: TDockManager;

  

The docking layout manager for this control.

published

  property Action: TBasicAction;

  

The Action associated with the control.

  property ActiveControl: TWinControl;

  

Specifies the active control on the form.

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property AllowDropFiles: Boolean;

  

Specifies whether files can be dropped onto this form.

  property AlphaBlend: Boolean;

  

Allows the form to be drawn with translucency.

  property AlphaBlendValue: Byte;

  

The translucence level for the form (0=transparent, 255=opaque).

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoScroll: Boolean;

  

Indicates if the form can automatically show or hide scroll bars.

  property AutoSize: Boolean;

  

Allows automatic adjustment of the size for the control, according to its content.

  property BiDiMode: TBiDiMode;

  

Indicates whether text controls use in bi-directional reading.

  property BorderIcons: TBorderIcons;

  

Specifies the icons which appear in the title bar for the form.

  property BorderStyle: TFormBorderStyle;

  

The border style affects the title bar, border and resize behavior of the form.

  property BorderWidth: TBorderWidth;

  

Width of the Border around the control; default is zero.

  property Caption: TCaption;

  

The text displayed for the control.

  property ChildSizing: TControlChildSizing;

  

Provides settings used to resize and align child controls using a tabular layout.

  property ClientHeight: Integer;

  

The height for the client area on the control.

  property ClientWidth: Integer;

  

The width of the client area for the control.

  property Color: TColor;

  

The background color for the form.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DefaultMonitor: TDefaultMonitor;

  

The monitor on which the form is displayed.

  property DesignTimePPI: Integer;

  

Design-time Pixels Per Inch for the designer surface.

  property DockSite: Boolean;

  

Allows controls to be drag-and-dock-ed into this control.

  property DoubleBuffered: Boolean;

  

When enabled, it reduces flicker when the control is painted.

  property DragKind: TDragKind;

  

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

  property DragMode: TDragMode;

  

Determines how a drag operation is started for the control.

  property Enabled: Boolean;

  

Determines whether the control responds to mouse or keyboard input.

  property Font: TFont;

  

The font to be used for text display in this control.

  property FormStyle: TFormStyle;

  

Indicates the style for the form.

  property HelpFile: string;

  

The name of the help file for the form.

  property Icon: TIcon;

  

The Icon associated with this Form (in minimized state).

  property KeyPreview: Boolean;

  

Allows the form to intercept keystrokes in child controls.

  property Menu: TMainMenu;

  

The main menu for the form instance.

  property OnActivate: TNotifyEvent;

  

Handler called when the form receives focus.

  property OnChangeBounds: TNotifyEvent;

  

Event handler signalled when the Bounds for the control have been changed.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnClose: TCloseEvent;

  

Handler called when the form is closed. It determines what happens to the form (destroy, hide, etc.).

  property OnCloseQuery: TCloseQueryEvent;

  

Event handler signalled when trying to close a form.

  property OnConstrainedResize: TConstrainedResizeEvent;

  

This handler can supply specific Constraints (size limits), when the control is resized.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnCreate: TNotifyEvent;

  

Handler called when the form has been created.

  property OnDblClick: TNotifyEvent;

  

Event handler signalled when a mouse double click occurs in the control.

  property OnDeactivate: TNotifyEvent;

  

Handler called when the form is deactivated (loses focus).

  property OnDestroy: TNotifyEvent;

  

Handler called when the form is destroyed.

  property OnDockDrop: TDockDropEvent;

  

Event handler signalled for the drop of a control to be docked.

  property OnDockOver: TDockOverEvent;

  

Event handler signalled when a control is moved over a docksite; determines whether the drop event is accepted or rejected.

  property OnDragDrop: TDragDropEvent;

  

Event handler signalled when an object is dropped onto the control.

  property OnDragOver: TDragOverEvent;

  

Event handler signalled when a control is dragged over the control instance.

  property OnDropFiles: TDropFilesEvent;

  

Handler called when files have been dropped.

  property OnEndDock: TEndDragEvent;

  

Event handler signalled for the end of a drag-dock operation.

  property OnGetSiteInfo: TGetSiteInfoEvent;

  

Provides information about the DockSite for the control.

  property OnHelp: THelpEvent;

  

Handler called when Help is requested.

  property OnHide: TNotifyEvent;

  

Handler called when the form is being hidden.

  property OnKeyDown: TKeyEvent;

  

Event handler signalled for key down keyboard events.

  property OnKeyPress: TKeyPressEvent;

  

Event handler signalled for character data entered by the user.

  property OnKeyUp: TKeyEvent;

  

Event handler signalled when a key up event has occurred for the control.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler signalled when the mouse pointer is moved in the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler signalled for a downward movement of the mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler signalled for an upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent;

  

Event handler signalled for a horizontal movement of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent;

  

Event handler signalled for a leftward movement of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent;

  

Event handler signalled for a rightward movement of the mouse wheel.

  property OnPaint: TNotifyEvent;

  

Event handler signalled to paint the control.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnShortCut: TShortCutEvent;

  

Event handler signalled when a key is pressed, before further handling of the key.

  property OnShow: TNotifyEvent;

  

Handler called when the form becomes visible.

  property OnShowHint: TControlShowHintEvent;

  

Event handler signalled when a hint window is displayed for the control.

  property OnStartDock: TStartDockEvent;

  

Event handler for the start of a docking operation.

  property OnUnDock: TUnDockEvent;

  

Event handler signalled before a control is undocked from its DockSite.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

  property OnWindowStateChange: TNotifyEvent;

  

Handler called when the form is minimized, maximized or restored.

  property ParentBiDiMode: Boolean;

  

Indicates whether the BiDiMode settings in the Parent control are used.

  property ParentDoubleBuffered: Boolean;

  

Value for the DoubleBuffered property in a Parent control.

  property ParentFont: Boolean;

  

Uses the font from the Parent when enabled.

  property PixelsPerInch: Integer;

  

Run-time Pixels Per Inch for the designer surface.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property PopupMode: TPopupMode;

  

Defines where pop-up menus are shown.

  property PopupParent: TCustomForm;

  

Parent form which owns the current form instance when displayed as a pop-up window.

  property Position: TPosition;

  

The initial placement for the form.

  property SessionProperties: string;

  

Delimited list of form and / or component properties saved to and restored from an external storage mechanism.

  property ScreenSnap: Boolean;

  

Indicates whether the form instance can be snapped to an edge on the monitor.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property ShowInTaskBar: TShowInTaskbar;

  

Indicates if the form should be displayed on the system Task Bar.

  property SnapBuffer: Integer;

  

Distance from (or proximity to) an edge on a snap target where the snapping behavior is automatically engaged.

  property SnapOptions: TWindowMagnetOptions;

  

Contains the form and screen snapping options for the form instance.

  property UseDockManager: Boolean;

  

Determines whether a DockManager is used for this DockSite.

  property LCLVersion: string; [rws]

  

The LCL version number as a String type.

  property Scaled: Boolean;

  

Indicates if the design surface is scaled to reflect changes in display density (Pixels Per Inch).

  property Visible: Boolean;

  

Indicates if the control is visible on its parent.

  property WindowState: TWindowState;

  

Indicates whether the form is displayed in a minimized, maximized, full-screen or normal state.

end;

Inheritance

TForm

  

Implements a form used in an LCL application.

|

TCustomForm

  

The base type for TForm classes.

|

TCustomDesignControl

  

Provides a designer surface for scaling and layout of its child controls.

|

TScrollingWinControl

  

Implements a windowed control with scroll bars.

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TForm is a TCustomForm descendant which implements a form displayed in an LCL application. It sets the visibility and default values for properties introduced in ancestor classes. It also adds methods needed for use as an MDI form in an application. LCL version information is available in the LCLVersion property, and is streamed to to the component resource file when a Parent is not assigned for the form.

Forms created at design-time using the Lazarus IDE are TForm descendants. A form can be used as the main form in an application, or it can be displayed as a MDI forms, dialog box, or tool window. Controls can added to the form, such as: TEdit, TLabel, TButton, TCheckBox, TComboBox, TListView, TTreeView, et. al.

See also

TCustomForm

  

The base type for TForm classes.


Version 3.2 Generated 2024-02-25 Home