locked
Mouse position, and mouse events. RRS feed

  • Question

  • I'm making an application to do repetitive tasks for people while they go away and do stuff.

    I need: A way to make the mouse left-click, a way to make the mouse ight-click, a way to make the mouse left-click-drag, a way of storing intervals (so that it can be x amount of time between event 1 and 2, and y time between 2 and 3) and some event handlers, such as, how to get the mouse position.

    My first problem, is that I can get the mouse position, but the value freezes if I move my mouse off the application, and as it's a background application, this is a problem. My current code is:

    Public Class Main194

    Private Sub Main194_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
    Me.Label1.Text = Control.MousePosition.X.ToString() + ", " + Control.MousePosition.Y.ToString()
    End Sub
    End Class

    More problems to come, I'm sure.
    Wednesday, April 25, 2007 8:57 PM

Answers

  • Take a look at the PointToClient method - I think you'll have more luck with that.

    Cheers,
    Menthos
    Thursday, April 26, 2007 7:12 AM

All replies

  • Take a look at the PointToClient method - I think you'll have more luck with that.

    Cheers,
    Menthos
    Thursday, April 26, 2007 7:12 AM
  • Ok, I give up, where do I find that?
    Thursday, April 26, 2007 7:26 AM
  • Pull it up in the help... it's pretty clear Smile

     

     

    Thursday, April 26, 2007 9:32 AM
  • None the wiser...  Sorry.
    Thursday, April 26, 2007 3:10 PM