要求运行后执行一些操作,并且不能显示窗口界面,当操作完成后自动结束程序。
我的方法是在form的create事件中先执行hide方法,进行操作后,用close结束程序运行。但问题是最终要出现循环操作。我估计在create事件中使用close就会有类似问题,请问怎么解决?另外,为了不显示窗口界面,有什么好的方法可以使运行时立即隐藏?
我的方法是在form的create事件中先执行hide方法,进行操作后,用close结束程序运行。但问题是最终要出现循环操作。我估计在create事件中使用close就会有类似问题,请问怎么解决?另外,为了不显示窗口界面,有什么好的方法可以使运行时立即隐藏?
把窗口height和width都设成0
2.将窗口的visible属性设成false
内容如下:
program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
改为:
program Project1;uses
Forms,Dialogs,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
// Application.CreateForm(TForm1, Form1);
//需要执行的操作,写在下面,注意在uses部分加入相关单元。
showmessage('Operation completed,terminate!');
Application.Run;
end.