秋
秋之叶
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1Class = class of TForm1;
TForm1 = class(TForm)
btnForm2: TButton;
btnForm3: TButton;
procedure btnForm2Click(Sender: TObject);
procedure btnForm3Click(Sender: TObject);
private
{ Private declarations }
public
procedure ShowForm(FClass: TForm1Class);
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3;
{$R *.dfm}
procedure TForm1.ShowForm(FClass: TForm1Class);
begin
Form1 := FClass.Create(Application);
Form1.ShowModal;
end;
procedure TForm1.btnForm2Click(Sender: TObject);
begin
ShowForm(TForm2);
end;
procedure TForm1.btnForm3Click(Sender: TObject);
begin
ShowForm(TForm3);
end;
end.
type
TForm2 = class(TForm1)
.....
end.
type
TForm3 = class(TForm1)
...
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1Class = class of TForm1;
TForm1 = class(TForm)
btnForm2: TButton;
btnForm3: TButton;
procedure btnForm2Click(Sender: TObject);
procedure btnForm3Click(Sender: TObject);
private
{ Private declarations }
public
procedure ShowForm(FClass: TForm1Class);
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3;
{$R *.dfm}
procedure TForm1.ShowForm(FClass: TForm1Class);
begin
Form1 := FClass.Create(Application);
Form1.ShowModal;
end;
procedure TForm1.btnForm2Click(Sender: TObject);
begin
ShowForm(TForm2);
end;
procedure TForm1.btnForm3Click(Sender: TObject);
begin
ShowForm(TForm3);
end;
end.
type
TForm2 = class(TForm1)
.....
end.
type
TForm3 = class(TForm1)
...
end.