首页 > 代码库 > FormCreate & FormActivate & FormShow执行顺序演示

FormCreate & FormActivate & FormShow执行顺序演示

procedure TForm1.FormCreate(Sender: TObject);
begin
  form1.Caption:=form1.Caption +‘+Create‘;

end;

procedure TForm1.FormActivate(Sender: TObject);
begin
  form1.Caption:=form1.Caption +‘+Activate‘;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
form1.Caption:=form1.Caption +‘+Show‘;
end;

 

运行结果:form1.caption:=‘Form1+Create+Show+Activate‘;

 

可见加载的顺序是

1、form1.Create

2、from1.Show

3、form1.Activate;

FormCreate & FormActivate & FormShow执行顺序演示