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
Solved

Maximize window in MDI

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process Javascript errors with Delphi TWebBrowser 1 178
Show Listview image from database (String field) 5 137
LAN or WAN ? 11 95
Multi-layered image in FireMonkey 9 49
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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