Sign in Join
Wiki copytemporary

TForm/zh CN: what changed

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

Title: TForm/zh CN

OldNewLine
1+**TForm** 是 [[Class|窗体]] 对象的类. 创建工程的所有Form都继承自TForm.
2+
3+窗体表示形成应用程序的用户界面的窗口或[[Application|应用程序]]. 它可以插入其他的组件 (例如: [[TButton|按钮]], [[TLabel|标签]], [[TEdit|输入框]], [[TImage|图像]]...) 来建立我们的工程.
4+
5+创建TForm的方式: [[IDE 界面: New Item|File|new...]]. 【之类建议大家使用英文界面,新手可以使用中文,一旦熟悉后尽量切换到英文,因为中文模式部分情况下可能有bug】
6+
7+## Application
8+
9+创建TForm方式: [[IDE Window: New Item|File|new...]] 或者直接点击新建图标,将会创建对应的类和单元. 为了使一个表单可以从另一个表单访问,需要将新表单添加到第一个表单单元的“uses”部分。 为了防止在每种形式都需要添加到另一种用途中时进行循环引用,需要在实现中将其添加到“uses”部分。 在程序启动时,实际上已实例化了主表单和任何其他必须“自动创建”的表单。 表单以它们在项目中列出的顺序开始。 自动创建窗体可以按照这个顺序操作 \[Project\|Project Options\|Forms\]. 如果由于某些原因可用的窗体未列出应自动创建的窗体, 将必要的窗体添加到 [[Program|program]]'s [[Uses|uses]] 的引用单元。 `Application.CreateForm` 来动态创建对应的窗体.
10+
11+项目源码 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+## 属性
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+## 事件
36+
37+- [[Action]], [[ActiveControl]], [[Constraints]], [[Menu]], [[OnActivate]], [[OnChangeBounds]], [[OnClick]], [[OnClose]], [[OnCloseQuery]], [[OnConstrainedResize]], [[OnContextPopup]], [[OnCreate]], [[OnDblClick]], [[OnDeactivate]], [[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+## 更多
40+
41+- [[doc:lcl/forms/tform.html|TForm doc]]
42+- [[Form Tutorial]]
43+
44+---
45+*From the Free Pascal wiki, page "TForm/zh CN", as it stood on 2021-02-12 after a change by TyphonFinger, 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