Danke für die schnelle Antwort.
Leider bekomme ich immer
Exception beim Aufruf...
Code Mainform:
Delphi-Quellcode:
unit mTest;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TMainform =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Mainform: TMainform;
implementation
uses mTest2;
{$R *.dfm}
procedure TMainform.Button1Click(Sender: TObject);
var pr1 : TEditor;
begin
pr1 := TEditor.Create(self);
pr1.ShowModal;
pr1.Free;
end;
procedure TMainform.Button2Click(Sender: TObject);
begin
ShowMessage('
Blub!');
end;
end.
Code Editor-Form:
Delphi-Quellcode:
unit mTest2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TEditor =
class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Editor: TEditor;
implementation
{$R *.dfm}
procedure TEditor.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:= caFree;
end;
procedure TEditor.Button1Click(Sender: TObject);
begin
Close;
end;
end.
Formstyle "Mainform" = fsMidForm
Formstyle "Editor" = fsMidChild
Hinweis:
Unter "Proejekt" -> "Optionen" -> "Formulare" befindet sich "Editor" auf der rechten Seite, wird also nicht autom. mitgeladen - was auch sein soll.