Board index » delphi » maximize childforms

maximize childforms

Hi, some help please

I have a MDIForm with 6 MDIChild forms in it, by running the application
the MDICild forms are closed, now wen i want to open a MDIChild form on
maximized, it shows me first the MDIChild form not maximized, and
0.5seconds later he maximzed it, il try'd everything, set the form on
maximized in the object inspector, set  WindowState := wsMaximized in the
formcreate, set height and width to maximum, it is still the same. How is
it possible to open a form directly maximized?

regards, mario

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet

 

Re:maximize childforms


Quote
mario.vandewa...@ping.be wrote:

> Hi, some help please

> I have a MDIForm with 6 MDIChild forms in it, by running the application
> the MDICild forms are closed, now wen i want to open a MDIChild form on
> maximized, it shows me first the MDIChild form not maximized, and
> 0.5seconds later he maximzed it, il try'd everything, set the form on
> maximized in the object inspector, set  WindowState := wsMaximized in the
> formcreate, set height and width to maximum, it is still the same. How is
> it possible to open a form directly maximized?

I have seen posts that do it better, but I have found success using
LockWindowUpdate();

Example:

   try
   Screen.Cursor := crHourglass;
   // LockWindowUpdate stops flickering when child is created
   lockwindowupdate(handle);
   Application.CreateForm(TCustomersForm, CustomersForm);
   CustomersForm.Show;
   CustomersForm.WindowState := wsMaximized;
   lockwindowupdate(0);
  except
    on E:Exception do
     begin
      ShowMessage(E.Message);
      Screen.Cursor := crDefault;
      Exit;
     end; {exception}
  end; {2nd try block}
 finally
  Screen.Cursor := crDefault;
 end; {1st try block}

Hope that helps!

Rkr

--
                   \|||/
                   /'^'\
                  ( 0 0 )
--------------oOOO--(_)--OOOo--------------
. Reid Roman                              .
. Delphi Programmer / Analyst             .
. TVisualBasic:=class(None);              .
. May the Source be With You              .
-------------------------------------------
. Auto-By-Tel (http://www.autobytel.com)  .
. Irvine, CA U.S.A                        .
. E-Mail : rkroman (at) pacbell (dot) net .
. or reidr (at) autobytel (dot) com       .
-------------------------------------------

Re:maximize childforms


Quote
>> I have a MDIForm with 6 MDIChild forms in it, by running the application
>> the MDICild forms are closed, now wen i want to open a MDIChild form on
>> maximized, it shows me first the MDIChild form not maximized, and
>> 0.5seconds later he maximzed it, il try'd everything, set the form on
>> maximized in the object inspector, set  WindowState := wsMaximized in the
>> formcreate, set height and width to maximum, it is still the same. How is
>> it possible to open a form directly maximized?

>I have seen posts that do it better, but I have found success using
>lockwindowupdate()

Lockwindowupdate still leaves you with one large "flicker" as the
entire screen is updated on unlock.

There is another way:
Create a hidden panel on your main form and show it during the
resizing of the child windows; it will mask the annoying window
flicker you describe. Sounds easy enough, but there are actually a
couple steps involved.
Download my "Making Delphi Do It" windows help file from:
http://www.fyi.net/~abass/domino/free.htm
to see all the details.
Do it this way for a very professional look.

Other Threads