Author: Tomas Rutkauskas
Set minimum/maximum values for a resizable form
Answer:
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:
1 type2 TForm1 = class(TForm)
3 protected4 procedure WMGetMinMaxInfo(varmessage: TWMGetMinMaxInfo);
5 message WM_GETMINMAXINFO;
6 end;
7 8 procedure TForm1.WMGetMinMaxInfo(varmessage: TWMGetMinMaxInfo);
9 begin10 withmessage.MinMaxInfo^ do11 begin12 ptMinTrackSize := Point(100, 100);
13 ptMaxTrackSize := Point(200, 200);
14 end;
15 end;