Mega Code Archive

 
Categories / Delphi / Forms
 

How to set a minimum size for a MDI form

Title: How to set a minimum size for a MDI form Question: How to set a minimum size of a window: Answer: An event-handler for WM_GETMINMAXINFO has to defined: ... private procedure WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo); message WM_GETMINMAXINFO; In the implementation section of the unit: procedure TForm1.WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo); begin Message.MinMaxInfo^.ptMinTrackSize := Point(Width, Height); Message.MinMaxInfo^.ptMaxTrackSize := Point(Width, Height); end;