方式一:设置项目的主窗体
Project -> Options -> Application -> Forms
方式二:直接改项目源文件
Project -> View Source
program Project_database; uses Vcl.Forms, Database in 'Database.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}; {$R *.res} begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); Application.Run; end.
把 上述代码中的 创建 Form1、Form2 的代码顺序调整一下,即把要第一个启动的窗体排在最上面:
Application.CreateForm(TForm2, Form2); Application.CreateForm(TForm1, Form1); Application.Run;
参考: