Solved

Maximize window in MDI

Posted on 1998-03-26
3
468 Views
Last Modified: 2010-04-06
I have written an MDI application.  Only one type of any specific MDI child can be open at any time.  Code is as follows:

procedure TMainForm.Customer_AccessClick(Sender: TObject);
var
  Child: TCustomerF;
  N    : Integer;  
begin
  { create a new MDI child window, The CUSTOMER ACCESS Form }
  Child := nil;
  with Application.MainForm do
    for N := 0 to MDIChildCount - 1 do
      if MDIChildren[N] is TCustomerF then
        Child := MDIChildren[N] as TCustomerF;
  if Child = nil then
    Child := TCustomerF.Create(Application)
  else
    with Child do
    begin
      if WindowState = wsMinimized then WindowState := wsNormal;
      BringToFront;
    end; {_ with Child do _}
end;

My problem is that if I have FORM_A maximized, open FORM_B, then FORM_A is put into normal mode.

I can't seem to have a maximized form without other forms being maximized as well.

What am I doing wrong?

Thanks
GTAS
0
Comment
Question by:gtas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:pjdb
ID: 1360884
All the MDI child have the same status. So if one is maximized, all are maximized, if one is not maximized all are not maximized. If you want to have some information in the MDI put them in the MDI or on a normal form which can be move a rezied by the MDI form to match the actual size.

JDB
0
 

Author Comment

by:gtas
ID: 1360885
Hi,
Thanks for answer.  I have two comments. The first part of your answer says that MDI cannot support one window maximized, and one window not maximized.  Isn't there any way around this?

The second comment is that I don't quite understand what you're saying when you state "If you want to have some information in the MDI put them in the MDI or on a normal form which can be move a rezied by the MDI form to match the actual size. "

All of my windows, except the SPLASH screen and the Main form which has my main menu, are MDI Child windows.

Can you clarify what you mean?

Thanks
GTAS

0
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 20 total points
ID: 1360886
I assume you want more than one child maximized in cas eteh user switches to the other windows (like press Ctrl+F6), they don't see a window in restored state.  I'd suggest this, on each fom's onActivate  procedure, put in code to set the window to maximixed. now the user may see a slight flicker with this procedure, so you may have to use the LockWindowUpdate call to get rid for the flicker (it depends on whther you create teh form or just switch to it).

Switching to another window makes the other windows go into restore (normal) state, which is teh default.  You ca get arond this by using the code above.  It rally doesn't matter if Windows puts a child in restore state, just as long as teh user doens't know about it or have to do anthing to get it back to maximized.  Good Luck.  Any questions, please ad a comment.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question