没看明白。什么是“鼠标不发生任何动作”?既然说“相应”是不是要拖动啊?
如果是,试试在Button的OnMouseMove里写——
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
P: TPoint;
begin
if not bCenter then//bCenter是一个全局变量,至于什么时候设为False看你的需要了,比如在OnMouseUp里。
if (X = Button1.Width div 2) and (Y = Button1.Height div 2) then bCenter := True;
if bCenter then begin
P := ScreenToClient(Button1.ClientToScreen(Point(X, Y)));
Button1.Left := P.x - Button1.Width div 2;
Button1.Top := P.y - Button1.Height div 2;
end;
end;