Solved

SDI Main Form

Posted on 1997-04-23
2
162 Views
Last Modified: 2010-04-04
I have an app which I am hoping will have a main form similar in appearance to Delphi (ie, a tool bar & menu bar across the top of the screen).  However, if the form is maximized it first enlarges the form to the size of the screen and then shrinks back to the size I set in onResize.

How do I make it stay at the same height even during maximization??  How do I limit the size of the form to X if it is resized using the sides of the window?

Its not a major problem, but it looks pretty dodgey.  Any help would be appreciated.
0
Comment
Question by:Stuart_Johnson
[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
2 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
ID: 1335646
You can do something like this...
     .
     .
     .
  private
    procedure LimitSize(var Info: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
  end;
     .
     .
     .
implementation

{$R *.DFM}

procedure TMainForm.LimitSize(var Info: TWMGetMinMaxInfo);
begin
  with Info.MinMaxInfo^.ptMaxTrackSize do begin
    {X := 640 or whatever you want;}
    Y := MyDefinedHeight {or something};
  end;
end;

That should do it!
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 1335647
MATE!!!!!  You are a genius!  Thanks a million!  I wasnt expecting a reply back so quickly - worked like a charm!

Just as a tip, can you make mention if a procedure/function/constant requires an external unit such as this one requiring MESSAGES.

Again, thanks mate....

Regards,


Stuart
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

731 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