when starting my application I create a form at runtime that contains a progress bar indicating the percent of data loaded from the DB. at the end of the loading, the main form displays and this temporary form is being closed. the problem is that when runing from delphi with F9 all is ok (the temp form is closed) while when runing from explorer like any other executable, if i change focus to another window (while the tempForm is being displayed), the temp form won't close anymore. i added a timer in the main form that checks for the existance of the tempForm and closes it if it's open but with no result.
the code is:
if I simply add a showmessage inside the if clause, everything works ok. this is kind of annoying since this tempForm won't even close when the 'X' button is pressed.
any help is greatly appreciated.
the code is:
Code:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if tempForm <> nil then
begin
tempForm.Close;
form1.Timer1.Enabled := false;
end;
end;
if I simply add a showmessage inside the if clause, everything works ok. this is kind of annoying since this tempForm won't even close when the 'X' button is pressed.
any help is greatly appreciated.