Board index » delphi » MDI Child Form (Need help)

MDI Child Form (Need help)

Hi anyone,
I write MDI application, my problem is that whenever I open a new MDI child
form I see it created and then resizing to be full page, I use the following
code in order to open the form:

  if f_CreditInvoicedPriceModificationEdit = nil then
     f_CreditInvoicedPriceModificationEdit :=
          Tf_CreditInvoicedPriceModificationEdit.Create(self);
  if f_CreditInvoicedPriceModificationEdit.WindowState = wsMinimized then
          f_CreditInvoicedPriceModificationEdit.WindowState := wsMaximized;
  f_CreditInvoicedPriceModificationEdit.Show;

My question is: Is there anything I can do to make the MDI child form apear
at once ?

    thanks,
            Tal Olier, mailto: ta...@rad.co.il

 

Re:MDI Child Form (Need help)


Quote
> I write MDI application, my problem is that whenever I open a new MDI child
> form I see it created and then resizing to be full page, I use the following
> code in order to open the form:

>   if f_CreditInvoicedPriceModificationEdit = nil then
>      f_CreditInvoicedPriceModificationEdit :=
>           Tf_CreditInvoicedPriceModificationEdit.Create(self);
>   if f_CreditInvoicedPriceModificationEdit.WindowState = wsMinimized then
>           f_CreditInvoicedPriceModificationEdit.WindowState := wsMaximized;
>   f_CreditInvoicedPriceModificationEdit.Show;

> My question is: Is there anything I can do to make the MDI child form apear
> at once ?

Well, MDI child forms are always created visible (required by the Windows MDI
framework). So you have to block the redrawing of the MDI main forms client
window (which owns the children):

 ok:= LockWindowUpdate( mainform.clienthandle );
 ...create MDi children
 If ok Then
   LockWindowUpdate( 0 );

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:MDI Child Form (Need help)


A simple way open your MDI child maximized is to put Maximized as value of
Windowstate in MDI child inspector !!!

Tal Olier a crit:

Quote
> Hi anyone,
> I write MDI application, my problem is that whenever I open a new MDI child
> form I see it created and then resizing to be full page, I use the following
> code in order to open the form:

>   if f_CreditInvoicedPriceModificationEdit = nil then
>      f_CreditInvoicedPriceModificationEdit :=
>           Tf_CreditInvoicedPriceModificationEdit.Create(self);
>   if f_CreditInvoicedPriceModificationEdit.WindowState = wsMinimized then
>           f_CreditInvoicedPriceModificationEdit.WindowState := wsMaximized;
>   f_CreditInvoicedPriceModificationEdit.Show;

> My question is: Is there anything I can do to make the MDI child form apear
> at once ?

>     thanks,
>             Tal Olier, mailto: ta...@rad.co.il

--
*****************************************************
Annie Pousse
Laboratoire de Biophysique et Medecine Nucleaire
2, place St Jacques
F-25000 Besan?on
Tel (33) 03 81 66 56 35
Fax (33) 03 81 66 56 11
*****************************************************

Re:MDI Child Form (Need help)


Thanks, worked great
        Tal.

Peter Below (TeamB) <100113.1...@compuXXserve.com> wrote in message ...

Quote
>> I write MDI application, my problem is that whenever I open a new MDI
child
>> form I see it created and then resizing to be full page, I use the
following
>> code in order to open the form:

>>   if f_CreditInvoicedPriceModificationEdit = nil then
>>      f_CreditInvoicedPriceModificationEdit :=
>>           Tf_CreditInvoicedPriceModificationEdit.Create(self);
>>   if f_CreditInvoicedPriceModificationEdit.WindowState = wsMinimized then
>>           f_CreditInvoicedPriceModificationEdit.WindowState :=
wsMaximized;
>>   f_CreditInvoicedPriceModificationEdit.Show;

>> My question is: Is there anything I can do to make the MDI child form
apear
>> at once ?

>Well, MDI child forms are always created visible (required by the Windows
MDI
>framework). So you have to block the redrawing of the MDI main forms client
>window (which owns the children):

> ok:= LockWindowUpdate( mainform.clienthandle );
> ...create MDi children
> If ok Then
>   LockWindowUpdate( 0 );

>Peter Below (TeamB)  100113.1...@compuserve.com)
>No e-mail responses, please, unless explicitly requested!

Other Threads