Solved

Maximize window in MDI

Posted on 1998-03-26
3
469 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month5 days, 3 hours left to enroll

635 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