Board index » cppbuilder » form loaded?

form loaded?


2006-01-21 02:02:37 AM
cppbuilder84
Hi there!!
How do I know if a form is Loaded and/or visible on screen?
Thanks!!
Andrea
 
 

Re:form loaded?

"Bono" < XXXX@XXXXX.COM >wrote in message
Quote
How do I know if a form is Loaded
You can use the OnShow event for that.
Quote
and/or visible on screen?
Since the OnShow event is triggered before the form is actually visible, you
can use the OnPaint event instead, which is triggered whenever the form is
drawn onscreen. If you want the code to run only once, you can set a flag
on the first triggering that later triggerings will ignore, for example:
bool FirstTime = true;
void __fastcall TForm1::FormPaint(TObject *Sender)
{
if( FirstTime )
{
FirstTime = false;
// your code here ...
}
}
Gambit