Solved

SDI Main Form

Posted on 1997-04-23
2
153 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 101
Intraweb download file link ? 1 135
Is anyone willing to have a look through this code and help debug? 25 77
CheckListBox usage 3 59
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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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 …

821 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