Get the Real-time Axis Position of the Mouse

The program is very easy, it enables the genuine position of the mouse and display the X-axis and Y-axis in real time. You only need a Form, a Label and a Timer.

Label Font size – 27.75

Code:
 
Public Class frmMousePosition ‘Name of your form


    Private Sub frmMousePosition_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start() ‘Enables the timer during form load
    End Sub

‘Displays the value of X and Y through navigation of the mouse
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim mousepoint As Point = MousePosition
        Label1.Text = mousepoint.ToString

    End Sub
End Class
Final Output:


You need to move the mouse to change the value of each axis position.
Get the Real-time Axis Position of the Mouse Get the Real-time Axis Position of the Mouse Reviewed by code-dev on 4:22 PM Rating: 5

No comments:

Powered by Blogger.