• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 683
  • Last Modified:

MDI Child Window Size

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
WoodyJ007
Asked:
WoodyJ007
  • 5
  • 2
1 Solution
 
kretzschmarCommented:
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
 
WoodyJ007Author Commented:
No.  Even after the child has been created I can not get the window bigger than 780.
0
 
kretzschmarCommented:
? 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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
WoodyJ007Author Commented:
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
 
WoodyJ007Author Commented:
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
 
WoodyJ007Author Commented:
hmmmmm... setting the BorderStyle to bsSingle DOES allow the height to be set greater than 780.
0
 
TasomiaCommented:
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
 
WoodyJ007Author Commented:
Superb!

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now