Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How to Move and Click with VB

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,330
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 27, 2009

The Code for clicking with the mouse is
//Code
Imports System.Windows.Forms
Imports System.Drawing
Public Class Click Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Public Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down Public Const MOUSEEVENTF_LEFTUP = &H4 ' left button up Public Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down Public Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up Public Shared Sub LeftDown() mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) End Sub Public Shared Sub LeftUp() mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) End Sub Public Shared Sub RightDown() mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0) End Sub Public Shared Sub RightUp() mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0) End Sub
End Class
//
The Code for moving with the mouse is
//Code
Imports System.Windows.Forms
Imports System.Drawing
Public Class Move Public Shared Sub SetMousePosition(ByVal x As Integer, ByVal y As Integer) Windows.Forms.Cursor.Position = New Point(x, y) End Sub
End Class
//
this is all in a class
and to left click: mouse.click.leftdown
and to move:mouse.move,setmousepoition(100,100)
this is a form

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (CODEINGWITHALEX)

  • do you know how to drag?

    coz I used this code for my mouse recorder

    it has left,right,middle click ... I dont know how to hold or drag it

  • @rocketrobotzrobotz11 yep just watch the newest mouse video

  • HELP!!! 2 Errors and one Warning its about the "Imports Mouse" It says that the Mouse cant be find... :/

  • Alright Tomorrow im going to post a new video

    of how to make the Mouse dll and i will post it on my site

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • the program works perfect!

  • How to Move and Click with VB

  • @CODEINGWITHALEX What vid is it? Ive watched some of ur mouse bids

  • @CODEINGWITHALEX Thanx! :)

  • Awsome

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more