private
{ Private declarations }
fOldClientHeight: Integer;
procedure WMNCRButtonDown(var Msg: TWMNCRButtonDown) ; message WM_NCRBUTTONDOWN;
procedure TForm1.WMNCRButtonDown(var Msg: TWMNCRButtonDown);
var
h : integer;
begin
if (Msg.HitTest = HTCAPTION) then
begin
if (ClientHeight = 0) then
begin
for h := 0 to fOldClientHeight do ClientHeight := h;
Application.ProcessMessages;
end
else
begin
fOldClientHeight := ClientHeight;
for h := fOldClientHeight downto 0 do ClientHeight := h;
Application.ProcessMessages;
end;
end;
end;
原始出處:About Delphi Programming