对队列使用帧通过代码
所以我有一个运行模拟的程序
当您选择模型时,它会打开一个屏幕,让您选择“运行模型”,这将打开另一个屏幕,您可以在其中按开始按钮
我想创建一个队列,以便用户可以选择多个模型,程序将在没有用户输入的情况下运行这些屏幕
所以,我调用这样的框架:
ProgForm := TProgressForm.Create(Self, FModItem);
Self.Visible := False;
try
ProgForm.ShowModal;
现在,我可以通过在 Create 末尾添加一行来运行模拟来运行程序,但问题是它直到结束才显示框架模拟(因为 Create 构造函数在我调用的 run 函数完成之前才完成)
我不知道该怎么做,因为如果我不在我调用的 Create 函数中添加任何内容,似乎就没有以任何其他方式自动调用任何函数,但如果我在创建中执行某些操作,则在创建完成之前不会显示框架
谢谢
So I have a program that runs a simulation
When you select the model, it opens a screen which lets you select "Run the Model", which opens another screen in which you can press the start button
I want to make a queue so that the user could select multiple models and the program would run through these screens without user input
So, I'm calling a frame like this:
ProgForm := TProgressForm.Create(Self, FModItem);
Self.Visible := False;
try
ProgForm.ShowModal;
Now, I can get the program to run by adding a line at the end of Create to run the simulation, but the problem is that it doesn't show the frame until the end of the simulation (since the Create constructor isn't finished until the run function I called is finished)
I'm not sure what to do, since if I don't add anything in the Create function I'm calling, there doesn't seem to be any other way to call any function automatically, but if I do something in Create, the frame isn't displayed until Create is finished
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议阅读:
http://delphi.about.com/od/formsdialogs/a /delphiformlife.htm
您可以使用表单的
OnShow
事件在表单完全绘制在屏幕上之前执行一些操作。OnActivate
通常是绘制表单时执行操作的最佳位置。顺便说一句
你说的是 Frame,但在你的代码中它说的是
TProgressForm
所以我猜你的意思是Form
里面有一个Frame
。I suggest reading:
http://delphi.about.com/od/formsdialogs/a/delphiformlife.htm
You can use the form's
OnShow
event to do stuff before the form is fully drawn on the screen.OnActivate
is usually the best place to do stuff when the form is drawn.BTW
you say Frame, but in your code it says
TProgressForm
so I'm guessing you meanForm
with aFrame
inside.