DelphiFAQ Home Search:

Set minimum/ maximum values for a resizable form

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

There is a windows message that requests the minimum and the maximum value for a
resizable window ('form').
The following code makes sure that a window of type TForm1 is not smaller than
100x100 and not larger than 200x200 pixels:

type
  TForm1 = class(TForm)  
  protected
    procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); 
      message WM_GETMINMAXINFO;  
  end;
procedure TForm1.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo);
begin
  with Message.MinMaxInfo^ do
  begin
    ptMinTrackSize := Point(100, 100);
    ptMaxTrackSize := Point(200, 200);
  end;
end;

Comments:

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Los Angeles, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.