开发者

Using frame through code for a queue

开发者 https://www.devze.com 2023-03-06 06:40 出处:网络
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

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 ca开发者_JAVA百科n 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


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 mean Form with a Frame inside.

0

精彩评论

暂无评论...
验证码 换一张
取 消