Solved

Maximize window in MDI

Posted on 1998-03-26
3
458 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
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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now