Board index » cppbuilder » Showing a form once another form is shown

Showing a form once another form is shown

Picture this: I have 2 forms.  I want form2 to display once form1 is shown.  form2 will be displayed modally.  I can't use form2->ShowModal inside form1's constructor because I want form1 to be totally drawn and visible behind form2.  I also can't show form1 first because it must be modal.  Unfortunately, I can't find an event that both guarantees that form1 will be totally drawn and that form2 will be immediately displayed once form1 is drawn.

Any suggestions?

Thanks

 

Re:Showing a form once another form is shown


Hi, Eugene,
Quote
>Unfortunately, I can't find an event that both guarantees >that form1 will

be totally drawn and that form2 will be >immediately displayed once form1 is
drawn.

how about a variable in Form1:
 bool firstshow=true;

and in the FormActivate of the form1:

 if (firstshow)
 {
  Form2->ShowModal();
  first=false;
 }

Good Luck

Michael

Re:Showing a form once another form is shown


Try form2->ShowModal in form1->FormShow.
Quote
Eugene wrote:
> Picture this: I have 2 forms.  I want form2 to display once form1 is shown.  form2 will be displayed modally.  I can't use form2->ShowModal inside form1's constructor because I want form1 to be totally drawn and visible behind form2.  I also can't show form1 first because it must be modal.  Unfortunately, I can't find an event that both guarantees that form1 will be totally drawn and that form2 will be immediately displayed once form1 is drawn.

> Any suggestions?

> Thanks

Other Threads