John, four more choices.
Put the code in AfterConstruction
Put the code in OnShow
Put the code in Loaded
Third, I generate my own event in a descended form class that I call
OnCreated.. which is perfect.
John Bird wrote:
A design question:
FormA (Main form) open all the time.
FormA opens FormB, and FormB filled with Data in On-activate event
FormB may open FormC or FormD for further details
When FormC or FormD is closed, sometimes FormB on-activate event is fired
again, sometimes not.
I haven't figured yet what decides whether FormB activate event gets fired
again - as far as I can tell its not whether FormC or FormD is modal or not.
I would prefer either it wasn't fired, or I could tell when it was going to
be so as to exit the event, as sometimes the data takes time to load again.
For instance opening Rave Report rvSystem printing options always does cause
a form (eg FormB) to get re-activated when it closes.
Is there a way I have missed to manage this?, or do I have to do some
housekeeping, eg
maintain my own state variable somewhere:
FormBLoadedData:Boolean
And in the FormB activate event have something like
if FormBLoadedData=true then exit;
LoadtheData;
FormBLoadedData:=true;
(this will prevent subsequent forms C and D reloading the data on FormB when
they close)
And on the close event for FormB have
FormBLoadedData:=false;
John
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi