// 在 X(10,50) Y(10,50) 这个区域内可以移动窗体。
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (Sender is TForm) and (X >= 10) and (X <= 50) and (Y >= 10) and (Y <= 50) then
begin
ReleaseCapture;
TForm(Sender).Perform(WM_SYSCOMMAND,$F012,0);
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Caption := 'X=' + IntToStr(X) + ' Y='+IntToStr(Y);
end;