风
风雨燕归来
Unregistered / Unconfirmed
GUEST, unregistred user!
form1对应unit1,form2对应unit2,form1上有一button.
分别如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage('asdfasdf');
end;
end.
unit Unit2;
interface
uses
unit1,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm1)
private
{ Private declarations }
public
{ Public declarations }
protected
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.
我要问的是,为什么form2继承自form1,在form2上为什么不显示form1的控件button???
分别如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage('asdfasdf');
end;
end.
unit Unit2;
interface
uses
unit1,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm1)
private
{ Private declarations }
public
{ Public declarations }
protected
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.
我要问的是,为什么form2继承自form1,在form2上为什么不显示form1的控件button???