unit FormStyle;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

// BeginExample: FormStyle
// Property: Forms.TCustomForm.FormStyle

// BeginCode
{
This example ensures that the main form of the application
is an MDI parent:
}
type
  TForm1 = class(TForm)
    Edit1: TEdit;
  private
    { Private declarations }
  public
    { Public declarations }
    constructor Create(AOwner : TComponent); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

constructor TForm1.Create(AOwner : TComponent);

begin
  inherited Create(AOwner);
  if FormStyle <> fsMDIForm then
    	  FormStyle := fsMDIForm;
  if FormStyle = fsMDIForm then
    	  Edit1.Text := 'MDI form'
  else
    //This line never executes
    Edit1.Text := 'Not an MDI form';
end;
// EndCode
// EndExample: FormStyle
end.
