Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Help with Cursor Position please?

$
0
0
Hello, I need help with something, I'm new. <3 uhmmm, ok so I want to move the mouse using:
Code:

Cursor.Position = new Point(100, 100)
However, I would like to create a label and a button on the form, then in the scripting, make the code do this on button click:
Code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Cursor.Position = New Point(Label1.x, Label1.y)
    End Sub

But the "Label.x" etc. comes up with errors :(

Also how do I make the mouse move only in the windows form so it won't mess up when I move my software window "the client" around on my desktop. I just wan't the mouse to stay in the form.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>