|
Limit the control size
TFormDesigner allows to limit the size of the resized control by the OnSizeLimit event. The follow code shows how to limit the maximal and minimal size of all buttons on the form. The minimal size is 40x20 pixels and the minimal size is 80x40 pixels.
procedure TForm1.FormDesigner1SizeLimit(Sender: TObject;
TheControl: TControl; var MinSize, MaxSize: TPoint);
begin
if TheControl is TButton then
begin
MinSize:=Point(40,20);
MaxSize:=Point(80,40);
end;
end;
|