And just to be different from everyone else.
 
Have the processing code run in a subthread and in it's onTerminate event close the form.  Remember to use critical sections when accessing the UI like the progress bar though.  The onTerminate event is run within the apps main thread so it's ok to do it from there.
 
Or something to that effect.  That way you will get proper UI re-draws without having to call application.processMessages all the time.  Oh and you can have a nice cancel button that'll animate (depress and rebound) when the user clicks it. :o)
 
 
Nahum Wild
Software Innovator & Process Consultant
IFE
PayGlobal
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Paul Mckenzie
Sent: Thursday, 26 February 2004 15:12 p.m.
To: Delphi List - Delphi
Subject: [DUG] Auto Killing a Modal Form

How do I Auto-Kill a Modal Form ?
 
I have a Form that I ShowModal
OnActivate or OnShow I do a load of processing (updating a ProgressBar).
Then I want the Form to automatically Close...
 
How do I get it to Close - I have tried setting ModalResult - but it seems to just get ignored.
If I set ModalResult in a Control the user activates  it works - but I need it to automatically Close.
 
 
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
 
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to