Sign in Join
Wiki copytemporary

TForm: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TForm

OldNewLine
1+**TForm** is the [[Class|class]] of a form object. All forms created at design time can be derived from TForm.
2+
3+The form represents a window or dialog box that forms the user interface of an [[Application|application]]. It is the container on which all other components (e.g. [[TButton|buttons]], [[TLabel|labels]], [[TEdit|edit fields]], [[TImage|images]]...) can be inserted.
4+
5+A new TForm can be created using [[IDE Window: New Item|File|new...]].
6+
7+## Application
8+
9+Forms created at design time using [[IDE Window: New Item|File|new...]] or clicking the new Form button, will create a new class or unit. To make one form accessable from another requires the new form to be added to the uses section of the unit for first form. To prevent circular referencing when each form requires to be added to the uses of the other, this will need to be added to a uses section under implementation. At program start, the main form and any other form that has to be 'autocreated' is actually instantiated. The forms are started in the sequence they are listed in the project. Autocreate forms may be selected from available forms in \[Project\|Project Options\|Forms\]. If for some reason available forms do not list the form that should be autocreated, add the necessary form name to the [[Program|program]]'s [[Uses|uses]] clause and add a line `Application.CreateForm` for that form.
10+
11+The project source code PTest.lpr:
12+
13+``` pascal
14+program PTest;
15+uses
16+ Forms,
17+ UMainForm,
18+ UOtherForm;
19+{$R *.res}
20+
21+begin
22+ Application.Title:='Test';
23+ RequireDerivedFormResource := True;
24+ Application.Initialize();
25+ Application.CreateForm(TMainForm, MainForm);
26+ Application.CreateForm(TOtherForm, OtherForm);
27+ Application.Run();
28+end.
29+```
30+
31+## Properties
32+
33+- [[Action]], [[ActiveControl]], [[Align]], [[AllowDropFiles]], [[AlphaBlend]], [[AlphaBlendValue]], [[Anchors]], [[AutoScroll]], [[AutoSize]], [[BiDiMode]], [[BorderIcons]], [[BorderStyle]], [[BorderWidth]], [[Caption]], [[ChildSizing]], [[Color]], [[Constraints]], [[Cursor]], [[DefaultMonitor]], [[DesignTimePPI]], [[DockSite]], [[DragKind]], [[DragMode]], [[Enabled]], [[Font]], [[FormStyle]], [[Height]], [[HelpKeyword]], [[HelpType]], [[Hint]], [[HorzScrollBar]], [[Icon]], [[KeyPreview]], [[Left]], [[Menu]], [[Name]], [[ParentBiDiMode]], [[ParentFont]], [[PixelsPerInch]], [[PopupMenu]], [[PopupMode]], [[PopupParent]], [[Position]], [[Scaled]], [[SessionProperties]], [[ShowHint]], [[ShowInTaskBar]], [[Tag]], [[Top]], [[UseDockManager]], [[VertScrollBar]], [[Visible]], [[Width]], [[WindowState]]
34+
35+## Events
36+
37+- [[Action]], [[ActiveControl]], [[Constraints]], [[Menu]], [[OnActivate]], [[OnChangeBounds]], [[OnClick]], [[OnClose]], [[OnCloseQuery]], [[OnConstrainedResize]], [[OnContextPopup]], [[TForm.OnCreate|OnCreate]], [[OnDblClick]], [[OnDeactivate]], [[TForm.OnDestroy|OnDestroy]], [[OnDockDrop]], [[OnDockOver]], [[OnDragDrop]], [[OnDragOver]], [[OnDropFiles]], [[OnEndDock]], [[OnGetSiteInfo]], [[OnHelp]], [[OnHide]], [[key down|OnKeyDown]], [[OnKeyPress]], [[OnKeyUp]], [[OnMouseDown]], [[OnMouseEnter]], [[OnMouseLeave]], [[OnMouseUp]], [[OnMouseWheel]], [[OnMouseWheelDown]], [[OnMouseWheelUp]], [[OnPaint]], [[OnResize]], [[OnShortCut]], [[OnShow]], [[OnShowHint]], [[OnStratDock]], [[OnUnDock]], [[OnUTF8KeyPress]], [[OnWindowStateChange]], [[PopupMenu]], [[PopupParent]]
38+
39+## See also
40+
41+- [[doc:lcl/forms/tform.html|TForm doc]]
42+- [[Form Tutorial]]
43+
44+---
45+*From the Free Pascal wiki, page "TForm", as it stood on 2022-07-16 after a change by Mario13, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history