Form2为弹出窗体
procedure TForm2.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if WindowFromPoint(ClientToScreen(Point(X, Y))) <> Handle then
begin
ReleaseCapture;
Hide;
end;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
SetCapture(Handle);
end;
procedure TForm2.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
SetCapture(Handle);
end;