FM Mobile Destroy Form

2019-08-29 11:19发布

问题:

How i can destroy form, I want: creatr Form1(start application), create Form 2, destroy Form1, working with form2, then create form 3, destroy form2. but I not know how to destroy form. If i call:

procedure TFPressStartScreen.btn1Click(Sender: TObject);
begin
  MainScreen.FMainScreen := MainScreen.TFMainScreen.Create(Application);
  MainScreen.FMainScreen.Show;
  DisposeOf;
end;

FPressStartScreen - 1 form, FMainScreen - 2 form, i create 2 form and need destroy 1. but i get access violation.