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
I suggest reading:
http://delphi.about.com/od/formsdialogs/a/delphiformlife.htm
You can use the form’s
OnShowevent to do stuff before the form is fully drawn on the screen.OnActivateis usually the best place to do stuff when the form is drawn.BTW
you say Frame, but in your code it says
TProgressFormso I’m guessing you meanFormwith aFrameinside.