D
delhpi
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses RegUnit, EdtUnit;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin with TEditEx.Create(self) do//继承的Edit运行正常 begin parent:=self; end;end;procedure TForm1.Button2Click(Sender: TObject);begin with TForm.Create(Application) do//直接用TForm也正常 begin show; end;end;procedure TForm1.Button3Click(Sender: TObject);begin with TFormReg.Create(Application) do//这里出错 begin show; end;end;end.==============unit EdtUnit;interfaceuses StdCtrls;type TEditEx = class(TCustomEdit);implementationend.=====================unit RegUnit;interfaceuses Forms;type TFormReg = class(TCustomForm);implementation{ TFormReg }end.