• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Mouse pointer postion

How can I shift mouse pointer to (x,y).
0
sal1150
Asked:
sal1150
3 Solutions
 
rbohacCommented:
0
 
sal1150Author Commented:
I want to shift its pointer to tcontroll....
example shift it to edit1.
0
 
Russell LibbySoftware Engineer, Advisory Commented:

procedure SetCursorToControl(Control: TControl);
var pt: TPoint;
begin
 
 pt:=Control.ClientToScreen(Point(0, 0));
 SetCursorPos(pt.X, pt.Y)

end;

rbohac deserves the points, as he did answer your original question. Do not assign me any points please.

Regards,
Russell

0
 
esoftbgCommented:
procedure TForm1.Button1Click(Sender: TObject);
begin
  SetCursorPos(Form1.Left + Edit1.Left + 8, Form1.Top + Edit1.Top + 40)
end;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now