TForm class
Implements a form used in an LCL application.
Declaration
TForm = class(TCustomForm)Inheritance
- TForm
- TCustomForm
- TCustomDesignControl
- TScrollingWinControl
- TCustomControl
- TWinControl
- TControl
- TLCLComponent
TComponent
Descends from it: TCalculatorForm TCalendarPopupForm TCustomCopyToClipboardDialog TFindDialogForm TLazarusFileDialogForm TLazMessageDialog TLCLTaskDialog TLoginDialog TReplaceDialogForm TTimePopupForm
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
Properties
ClientHandle | public | The Handle of the MDIForm client (container for MDI children). |
DockManager | public | The docking layout manager for this control. |
Action | published | The Action associated with the control. |
ActiveControl | published | Gets or sets the active control on the form. |
Align | published | Specifies the placement of the control on its Parent control. |
AllowDropFiles | published | Specifies whether files can be dropped onto this form. |
AlphaBlend | published | Allows the form to be drawn with translucency. |
AlphaBlendValue | published | The translucence level for the form (0=transparent, 255=opaque). |
Anchors | published | The set of anchor definitions for this control. |
AutoScroll | published | Indicates if the form can automatically show or hide scroll bars. |
AutoSize | published | Allows automatic adjustment of the size for the control, according to its content. |
BiDiMode | published | Indicates whether text controls use in bi-directional reading. |
BorderIcons | published | Specifies the icons which appear in the title bar for the form. |
BorderStyle | published | The border style affects the title bar, border, icon(s), and resize behavior for the form. |
BorderWidth | published | Width of the Border around the control; default is zero. |
Caption | published | The text displayed in the title bar for the form. |
ChildSizing | published | Provides a grid (table) layout for the children of this control. |
ClientHeight | published | The height for the client area on the control. |
ClientWidth | published | The width of the client area for the control. |
Color | published | The background color for the form. |
Constraints | published | Contains the minimum and maximum Width and Height for the control. |
DefaultMonitor | published | The monitor on which the form is displayed. |
DesignTimePPI | published | Design-time Pixels Per Inch for the designer surface. |
DockSite | published | Allows controls to be drag-and-dock-ed into this control. |
DoubleBuffered | published | When enabled, it reduces flicker when the control is painted. |
DragKind | published | Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock. |
DragMode | published | Determines how a drag operation is started for the control. |
Enabled | published | Determines whether the control responds to mouse or keyboard input. |
Font | published | The font to be used for text display in this control. |
FormStyle | published | Indicates the style for the form. |
HelpFile | published | The name of the help file for the form. |
Icon | published | The Icon associated with this Form (in minimized state). |
KeyPreview | published | Allows the form to intercept keystrokes in child controls. |
Menu | published | The main menu for the form instance. |
ParentBiDiMode | published | Indicates whether the BiDiMode settings in the Parent control are used. |
ParentDoubleBuffered | published | Value for the DoubleBuffered property in a Parent control. |
ParentFont | published | Uses the font from the Parent when enabled. |
PixelsPerInch | published | Run-time Pixels Per Inch for the designer surface. |
PopupMenu | published | A context-sensitive menu that pops up when the right mouse button is clicked over this control. |
PopupMode | published | Defines where pop-up menus are shown. |
PopupParent | published | Parent form which owns the current form instance when displayed as a pop-up window. |
Position | published | The initial placement for the form. |
SessionProperties | published | Delimited list of form and / or component properties saved to and restored from an external storage mechanism. |
ScreenSnap | published | Indicates whether the form instance can be snapped to an edge on the monitor. |
ShowHint | published | Enables Hint display for the control. |
ShowInTaskBar | published | Indicates if the form should be displayed on the system Task Bar. |
SnapBuffer | published | Distance from (or proximity to) an edge on a snap target where the snapping behavior is automatically engaged. |
SnapOptions | published | Contains the form and screen snapping options for the form instance. |
UseDockManager | published | Determines whether a DockManager is used for this DockSite. |
LCLVersion | published | The LCL version number as a String type. |
Scaled | published | Indicates if the design surface is scaled to reflect changes in display density (Pixels Per Inch). |
TileMode | published | Controls the layout order for MDI child forms for a MDI form instance. |
Visible | published | Indicates if the control is visible on its parent. |
WindowState | published | Indicates whether the form is displayed in a minimized, maximized, full-screen or normal state. |
Methods
WSRegisterClass | protected | Creates an association between the class type and its widgetset class. |
CreateWnd | protected | Creates the handle for the widgetset class and updates it menu and icons. |
Loaded | protected | Performs actions when LCL component streaming has been completed for the form instance. |
Create | public | Constructor for the class instance. |
Cascade | public | Arranges MDI child forms so they overlap. |
Next | public | Activates the next MDI child form (fsMDIChild) in the form sequence. |
Previous | public | Activates the previous MDI child form (fsMDIChild) in the form sequence. |
Tile | public | Arranges MDI child forms using the TileMode for the MDI form. |
ArrangeIcons | public | Arranges the icons for minimized forms in a MDI form. |
Events
OnActivate | published | Handler signalled when the form instance receives focus. |
OnChangeBounds | published | Event handler signalled when the Bounds for the control have been changed. |
OnClick | published | Notification handler for mouse clicks. |
OnClose | published | Handler called when the form is closed. It determines what happens to the form (destroy, hide, etc.). |
OnCloseQuery | published | Event handler signalled when trying to close a form. |
OnConstrainedResize | published | This handler can supply specific Constraints (size limits), when the control is resized. |
OnContextPopup | published | Invoked when a context-sensitive pop-up menu is requested. |
OnCreate | published | Handler called when the form has been created. |
OnDblClick | published | Event handler signalled when a mouse double click occurs in the control. |
OnDeactivate | published | Handler signalled when the form is deactivated (loses focus). |
OnDestroy | published | Handler called when the form is destroyed. |
OnDockDrop | published | Event handler signalled for the drop of a control to be docked. |
OnDockOver | published | Event handler signalled when a control is moved over a docksite; determines whether the drop event is accepted or rejected. |
OnDragDrop | published | Event handler signalled when an object is dropped onto the control. |
OnDragOver | published | Event handler signalled when a control is dragged over the control instance. |
OnDropFiles | published | Handler called when files have been dropped. |
OnEndDock | published | Event handler signalled for the end of a drag-dock operation. |
OnGetSiteInfo | published | Provides information about the DockSite for the control. |
OnHelp | published | Handler called when Help is requested. |
OnHide | published | Handler called when the form is being hidden. |
OnKeyDown | published | Event handler signalled for key down keyboard events. |
OnKeyPress | published | Event handler signalled for character data entered by the user. |
OnKeyUp | published | Event handler signalled when a key up event has occurred for the control. |
OnMouseDown | published | Event handler signalled when a mouse down event is handled for the control. |
OnMouseEnter | published | Event handler signalled when the mouse pointer has entered the control. |
OnMouseLeave | published | Event handler signalled when the mouse pointer has left the control. |
OnMouseMove | published | Event handler signalled when the mouse pointer is moved in the control. |
OnMouseUp | published | Event handler signalled when a mouse up event is handled for the control. |
OnMouseWheel | published | Event handler for mouse wheel turned. |
OnMouseWheelDown | published | Event handler signalled for a downward movement of the mouse wheel. |
OnMouseWheelUp | published | Event handler signalled for an upward movement of the mouse wheel. |
OnMouseWheelHorz | published | Event handler signalled for a horizontal movement of the mouse wheel. |
OnMouseWheelLeft | published | Event handler signalled for a leftward movement of the mouse wheel. |
OnMouseWheelRight | published | Event handler signalled for a rightward movement of the mouse wheel. |
OnPaint | published | Event handler signalled to paint the control. |
OnResize | published | Event handler signalled when the size for the form is changed. |
OnShortCut | published | Event handler signalled when a key is pressed, before further handling of the key. |
OnShow | published | Handler called when the form becomes visible. |
OnShowHint | published | Event handler signalled when a hint window is displayed for the control. |
OnStartDock | published | Event handler for the start of a docking operation. |
OnUnDock | published | Event handler signalled before a control is undocked from its DockSite. |
OnUTF8KeyPress | published | Handler for a character entered by the user. |
OnWindowStateChange | published | Handler called when the form is minimized, maximized or restored. |
Inherited
From TCustomForm (135)
Activate Active ActiveChanged ActiveDefaultControl ActiveMDIChild AddHandlerClose AddHandlerCreate AddHandlerFirstShow AdjustClientRect AfterConstruction AllAutoSized AutoScale AutoSizeDelayedHandle BeforeDestruction BeginAutoDrag BeginFormUpdate BigIconHandle CalculatePreferredSize CancelControl CanFocus ChildHandlesCreated Close CloseQuery CMActionExecute CMActionUpdate CMActivate CMAppShowBtnGlyphChanged CMAppShowMenuGlyphChanged CMBiDiModeChanged CMDeactivate CMIconChanged CMParentBiDiModeChanged CMRelease CMShowingChanged ColorIsStored ConstrainedResize CreateNew CreateParams Deactivate DefaultControl DefocusControl Designer Destroy DestroyWnd DoAddActionList DoAutoSize Dock DoClose DoCreate DoDestroy DoDock DoExecuteAction DoFirstShow DoHide DoOnChangeBounds DoOnResize DoRemoveActionList DoShow DoShowWindow DoUpdateAction EffectiveShowInTaskBar EndFormUpdate EnsureVisible FocusControl FormIsUpdating FormState GetChildren GetControlClassDefaultSize GetDefaultDockCaption GetFloating GetFormImage GetMDIChildren GetPreferredSize GetRealPopupParent GetRolesForControl HandleCreateException HandleDestroyException HandleShowHideException Hide InitializeWnd IntfDropFiles IntfHelp IsShortcut LastActiveControl MakeFullyVisible MDIChildCount MDIChildren ModalResult Monitor MoveToDefaultPosition Notification OnShowModalFinished PaintWindow ProcessResource Release RemoveAllHandlersOfObject RemoveHandlerClose RemoveHandlerCreate RemoveHandlerFirstShow RequestAlign Resizing RestoredHeight RestoredLeft RestoredTop RestoredWidth SetAutoScroll SetAutoSize SetFocus SetFocusedControl SetParent SetRestoredBounds SetScaled SetVisible SetZOrder Show ShowModal ShowOnTop SmallIconHandle UpdateActions UpdateDockCaption UpdateShowing UpdateWindowState VisibleChanged VisibleChanging VisibleIsStored WantChildKey WMActivate WMCloseQuery WMDPIChanged WMHelp WMShowWindow WMSize WMWindowPosChanged WMWindowPosChanging WndProc
From TCustomDesignControl (2)
From TScrollingWinControl (16)
AlignControls AutoScrollEnabled CalculateAutoRanges ClientToScreen ComputeScrollbars GetClientScrollOffset GetLogicalClientRect GetPreferredSizeClientFrame HorzScrollBar ScreenToClient ScrollBy ScrollInView UpdateScrollbars VertScrollBar WMHScroll WMVScroll
From TCustomControl (5)
From TWinControl (197)
AddControl AutoSizeDelayed AutoSizeDelayedReport AutoSizePhases BeginUpdateBounds BoundsLockCount BroadCast Brush BrushCreated CachedClientHeight CachedClientWidth CanSetFocus CanTab ChangeScale ChildClassAllowed ChildKey ClientRectNeedsInterfaceUpdate CMBorderChanged CMDoubleBufferedChanged CMEnabledChanged CMEnter CMExit CMParentDoubleBufferedChanged CMShowHintChanged CMVisibleChanged CNChar CNKeyDown CNKeyUp CNSysKeyDown CNSysKeyUp ContainsControl ControlAtPos ControlCount ControlKeyDown ControlKeyUp Controls ControlsAligned CreateBrush CreateDockManager CreateHandle CreateParented CreateParentedControl CreateSubClass CustomAlignInsertBefore CustomAlignPosition DefaultHandler DefWndProc DesignerDeleting DestroyHandle DialogChar DisableAlign DoAddDockClient DoAdjustClientRectChange DoAlignChildControls DoAllAutoSize DoChildSizingChange DockClientCount DockClients DockDrop DockOver DoConstraintsChange DoDockClientMsg DoDockOver DoDragMsg DoEnter DoExit DoFlipChildren DoFloatMsg DoGetDockCaption DoKeyDownBeforeInterface DoKeyPress DoKeyUpBeforeInterface DoRemainingKeyDown DoRemainingKeyUp DoRemoveDockClient DoSendBoundsToInterface DoSendShowHideToInterface DoSetBounds DoUnDock DoUndockClientMsg DoUTF8KeyPress EnableAlign EndUpdateBounds EraseBackground FinalizeWnd FindChildControl FindNextControl FixDesignFontsPPIWithChildren FixupTabList FlipChildren Focused FormEndUpdated GetAdjustedLogicalClientRect GetBorderStyle GetChildrenRect GetClientOrigin GetClientRect GetControlIndex GetControlOrigin GetDeviceContext GetDockCaption GetEnumeratorControls GetEnumeratorControlsReverse GetMouseCapture GetParentHandle GetSiteInfo GetTabOrderList GetTextLen GetTopParentHandle Handle HandleAllocated HandleNeeded InsertControl IntfGetDropFilesTarget IntfUTF8KeyPress Invalidate InvalidateBoundsRealized InvalidateClientRectCache InvalidatePreferredChildSizes IsClientHeightStored IsClientWidthStored IsControlMouseMsg IsFlipped IsResizing IsSpecialSubControl KeyDown KeyDownAfterInterface KeyDownBeforeInterface KeyPress KeyUp KeyUpAfterInterface KeyUpBeforeInterface LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnEnter OnExit OnGetDockCaption PaintControls PaintHandler PaintTo ParentFormHandleInitialized ParentHandlesAllocated ParentWindow PerformTab RealGetText ReAlign RealizeBounds RealizeBoundsRecursive RealSetText ReloadDockedControl RemoveControl RemoveFocus Repaint ScaleBy ScaleControls ScrollBy_WS SelectFirst SelectNext SendDialogChar SendMoveSizeMessages SetBorderStyle SetBounds SetChildZPosition SetControlIndex SetDockManager SetShape SetTempCursor ShowControl Showing TabOrder TabStop UnlockRealizeBounds Update UpdateControlState UTF8KeyPress VisibleDockClientCount WindowHandle WMChar WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMKillFocus WMMove WMNotify WMSetFocus WMSysChar WMSysKeyDown WMSysKeyUp WriteLayoutDebugReport WSSetText
From TControl (295)
AccessibleDescription AccessibleName AccessibleRole AccessibleValue ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDragStart BeginAutoSizing BeginDrag BorderSpacing BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize CaptureChanged CaptureMouseButtons ChangeBounds Changed CheckChildClassAllowed CheckNewParent CheckOnChangeBounds Click ClientOrigin ClientRect ClientToParent CMChanged CMCursorChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CNPreferredSizeChanged ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DblClick DefineProperties DesktopFont DisableAutoSizing DoBorderSpacingChange DoCallKeyEventHandler DoCallMouseWheelEventHandler DoCallNotifyHandler Docked DockOrientation DockTrackNoTarget DoContextPopup DoEndDock DoEndDrag DoFixDesignFontPPI DoMouseDown DoMouseUp DoMouseWheel DoMouseWheelDown DoMouseWheelHorz DoMouseWheelLeft DoMouseWheelRight DoMouseWheelUp DoOnParentHandleDestruction DoOnShowHint DoScaleFontPPI DoStartDock DoStartDrag DragCanceled DragCursor DragDrop Dragging DragOver EditingDone EnableAutoSizing EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass ForeignAnchorSideChanged GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetColorResolvingParent GetCursor GetDefaultColor GetDefaultHeight GetDefaultWidth GetDockEdge GetDragImages GetEnabled GetFloatingDockSiteClass GetMousePosFromMessage GetPalette GetParentBackground GetParentComponent GetPopupMenu GetRGBColorResolvingParent GetScrolledClientRect GetSelectedChildAccessibleObject GetSidePosition GetTextBuf GetTopParent HandleObjectShouldBeVisible HasHelp HasParent Height HeightIsAnchored HelpContext HelpKeyword HelpType Hint HostDockSite InitiateAction InvalidateControl InvalidatePreferredSize IsAParentAligning IsBorderSpacingInnerBorderStored IsCaptionStored IsControl IsControlVisible IsEnabled IsParentColor IsParentFont IsParentOf IsProcessingPaintMsg IsRightToLeft IsVisible Left LMCaptureChanged LoadedAll LRDockWidth ManualDock ManualFloat MouseCapture MouseDown MouseEnter MouseInClient MouseLeave MouseMove MouseUp OnEditingDone OnEndDrag OnQuadClick OnStartDrag OnTripleClick Parent ParentBackground ParentColor ParentDestroyingHandle ParentFontChanged ParentShowHint ParentToClient Perform PositionDockRect QuadClick ReadBounds ReadState Refresh RemoveHandler RemoveHandlerOnBeforeDestruction RemoveHandlerOnChangeBounds RemoveHandlerOnEnabledChanged RemoveHandlerOnEnabledChanging RemoveHandlerOnKeyDown RemoveHandlerOnMouseWheel RemoveHandlerOnResize RemoveHandlerOnVisibleChanged RemoveHandlerOnVisibleChanging ReplaceDockedControl Resize Scale96ToFont Scale96ToForm Scale96ToScreen ScaleConstraints ScaleDesignToForm ScaleFontsPPI ScaleFontTo96 ScaleFontToScreen ScaleFormTo96 ScaleFormToDesign ScaleScreenTo96 ScaleScreenToFont ScreenToControl SendToBack SetAction SetAlign SetAnchors SetBiDiMode SetBoundsKeepBase SetCursor SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParentBackground SetParentBiDiMode SetParentComponent SetTextBuf ShouldAutoAdjust ShowHelp TBDockHeight Text TextChanged Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar Width WidthIsAnchored WindowProc WMCancelMode WMLButtonDBLCLK WMLButtonDown WMLButtonQuadCLK WMLButtonTripleCLK WMLButtonUp WMMButtonDBLCLK WMMButtonDown WMMButtonQuadCLK WMMButtonTripleCLK WMMButtonUp WMMouseHWheel WMMouseMove WMMouseWheel WMRButtonDBLCLK WMRButtonDown WMRButtonQuadCLK WMRButtonTripleCLK WMRButtonUp WMXButtonDBLCLK WMXButtonDown WMXButtonQuadCLK WMXButtonTripleCLK WMXButtonUp
From TLCLComponent (6)
DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance WidgetSetClass
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
