Thursday, December 15, 2011

Mouse Locator

1. A program showing the location of the pointer (x and y) in the title bar. Form name is "frm1".





2. Enter the CODE:


Public Class frm1

Private Sub MouseLocator_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub MouseLocator_Mousemove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove

Me.Text = "Your location in X is " & e.X & " and Y is " & e.Y

End Sub

Private Sub backtoindex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backtoindex.Click

Me.Close()

End Sub
End Class

3. Save and Run your program.

No comments:

Post a Comment