我在关闭窗体是用了:
form1.Close;
form1.Free;可是再次打开窗体的时候总是出错,不知为何?acces violation at adress 00000000,read of adress 00000000还请各位高手指教!
form1.Close;
form1.Free;可是再次打开窗体的时候总是出错,不知为何?acces violation at adress 00000000,read of adress 00000000还请各位高手指教!
去掉Form.free就可以了
procedure TForm1.Button1Click(Sender: TObject);
begin
form1:=Tform1.Create(nil);
form1.Show;
end;
如果窗体是自己控制的,则需要创建和释放。
var
fa: TAboutForm;
begin
fa := TAboutForm.Create(Self);
fa.ShowModal;
fa.Free;
end;
begin
Action := caFree;
end;