Solved

SDI Main Form

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

20 Experts available now in Live!

Get 1:1 Help Now