Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
Set minimum/ maximum values for a resizable form
This 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:
|