Mouseclick

Z

zoneal

I have a little question. How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.

Thanks
 
V

VBen

In .Net, I don't know if there's a method, but using Windows API, you can
send a message (SendMessage) with WM_LMOUSEDOWN and then WM_LMOUSEUP
messages in the position you want. There's documentation in these two
messages in MSDN library to see how they expect the lParam and wParam of
SendMessage.
Hope this helps.
VBen.
 
Q

Qwert

I have a little question. How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.

Thanks

Not sure with what you mean with 'let my mouse click'...trigger the
functionality in a certain button event? Move that functionality to a
seperate function so you can call it from other places in your code. Handle
the mouse move event, triggering a function when coordinates are 10,750:

Private Sub ControlName_MouseMove(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ControlName.MouseMove
.....
If Cursor.Position.X = 10 And Cursor.Position.Y = 750 Then
REM Call function.
End If
.....
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top