プロジェクトのフォームとフレームの違いを観察します。
最初にproject.dprソース:
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit3 in 'Unit3.pas' {Frame3: TFrame};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
違い:
- IDEにどのデザイナーを使用すべきかを伝えるためのより詳細なコメントとしてのフレーム
- フォームは自動作成できます
Dfmファイル:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 348
ClientWidth = 643
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
end
と
object Frame3: TFrame3
Left = 0
Top = 0
Width = 320
Height = 240
TabOrder = 0
end
フレームには次のプロパティはありません。
- キャプション
- ClientHeight
- ClientWidth
- 色
- Font.Charset
- Font.Color
- Font.Height
- Font.Name
- Font.Style
- OldCreateOrder
- PixelsPerInch
- TextHeight
補足:フレームには次のイベントはありません。
フレームには、次のようなグローバル変数はありません。
var
Form1: TForm1;
また、フレームは。から派生しますTFrame
が、フォームは。から派生しTForm
ます。
注:フレーム/フォームの継承を使用すると、ステップが少し長くなります。
--jeroen