让鼠标移动到控件上的方法
procedure MoveMouseIntoControl(AWinControl: TWincontrol);
var
rtControl: TRect;
begin
rtControl := AWinControl.BoundsRect;
MapWindowPoints(AWinControl.Parent.Handle, 0, rtControl, 2);
SetCursorPos(rtControl.Left + (rtControl.Right - rtControl.Left) div 2,
rtControl.Top + (rtControl.Bottom - rtControl.Top) div 2);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
MoveMouseIntoControl(Button1);
end;