Solved

MDI Child Window Size

Posted on 2002-06-19
8
626 Views
Last Modified: 2010-04-04
Hi Guys,
  I'm having a problem with MDI Child windows.

It appears that I cannot set the height of the child greater than 780.  Why is this? And how can I override this behaviour?

I'm using Delphi 6 Ent and Win2k

:To reproduce
Use delphi's project wizard to create a standard MDI application.  In the 'CreateMDIChild' procedure add  

Child.Height := 1000;
Child.Width := 1024;

and evaluate height after it has executed it.  The value is still 780 and will not go any higher.


Many Thanks
Woody
0
Comment
Question by:WoodyJ007
  • 5
  • 2
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7092047
the height and width of a child is corrected by os(?),
for view as cascade-style,

you may re-adjust width and height,
in a (maybe onshow) event

meikl ;-)
0
 

Author Comment

by:WoodyJ007
ID: 7092050
No.  Even after the child has been created I can not get the window bigger than 780.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7092063
? maybe you've it maximized,

in this case the childform fits into the clientarea of the mainform, and any try of a change may then resetted to mainform-clientarea-size

0
 

Author Comment

by:WoodyJ007
ID: 7092085
Nope.  Try creating a project using the wizard and you'll see what I mean.  I've tried changing my screen resolution up to 1280 by 960 and the child allows me to change it's size to 978 but no higher!

So your right about the OS somehow fixing the maximum size but now I need a way of overriding it.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:WoodyJ007
ID: 7092190
I've now tried this in VB and VC++ all of which give the same results.

This is standard windows behaviour.....but can it be overridden???

Cheers
0
 

Author Comment

by:WoodyJ007
ID: 7092200
hmmmmm... setting the BorderStyle to bsSingle DOES allow the height to be set greater than 780.
0
 
LVL 2

Accepted Solution

by:
Tasomia earned 300 total points
ID: 7092247
Hi,

Trap the WM_GETMINMAXINFO message to allow a heigher
size.

tas


  private
      procedure GetMinMaxInfo(var Msg: TWMGETMINMAXINFO); message WM_GETMINMAXINFO;
  public
  end;

var
  MDIForm: TMDIForm;

implementation

{$R *.DFM}

procedure TMDIForm.GetMinMaxInfo(var Msg: TWMGETMINMAXINFO);
begin
  inherited;
  with Msg.MinMaxInfo^ do
  begin
    ptMaxTrackSize.Y := 2000; // max. Height
  end;
end;


procedure TMDIForm.Button1Click(Sender: TObject);
begin
  MDIForm.Height := 1000;
end;
0
 

Author Comment

by:WoodyJ007
ID: 7092256
Superb!

Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

21 Experts available now in Live!

Get 1:1 Help Now