محدودكردن تغییر اندازه فرم در دلفی
گاهی اوقات نیاز است فرم ما از نظر اندازه پیرو یک الگو باشد و کاربر نتواند خارج از محدوده این فرم را تغییر اندازه دهد، راهی که پیشنهاد می شود، استفاده از Windows Messages، تابع WM_GetMinMaxInfo میباشد.

کد:
unit MinMax; 

interface 

uses 
SysUtils,  WinTypes, WinProcs, Messages, Classes, Graphics, Controls, 
Forms, Dialogs;  

type 
TForm1 = class(TForm) 
private 
{ Private declarations }  
procedure WMGetMinMaxInfo(var MSG: Tmessage); message WM_GetMinMaxInfo;  
public 
{ Public declarations } 
end; 

var 
Form1: TForm1;  

implementation 

{$R *.DFM} 

procedure  TForm1.WMGetMinMaxInfo(var MSG: Tmessage); 
Begin 
inherited; 
with  PMinMaxInfo(MSG.lparam)^ do 
begin 
with ptMinTrackSize do 
begin 
X  := 300; 
Y := 150; 
end; 
with ptMaxTrackSize do 
begin 
X :=  350; 
Y := 250; 
end; 
end; 
end; 

end.

__________________