FUDEI:
震惊之余,打开DELPHI5,试了,没问题啊,怎么回事?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Edit1: TEdit;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
if not assigned(edit1) then
showmessage('dddd')
else
showmessage('Create');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1 := TEdit.Create(Form1);
end;
end.