Public Class Form1 Inherits System.Windows.Forms.Form
'Windows Form Designer Generated Code
Private Sub Form1_Mousedown(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
If e.Button = MouseButtons.Left Then
TextBox1.Text = "Mouse down at" + CStr(e.X) + " :" + CStr(e.Y)
'displaying the coordinates in TextBox1 when the mouse is pressed on the form
End If
End Sub
Private Sub Form1_MouseEnter(ByVal sender As System.Object, ByVal e_
As System.EventArgs) Handles MyBase.MouseEnter
TextBox2.Text = "Mouse Entered"
'displaying "mouse entered" in TextBox2 when the mouse pointer enters the form
End Sub
Private Sub Form1_MouseLeave(ByVal sender As System.Object, ByVal e_
As System.EventArgs) Handles MyBase.MouseLeave
TextBox3.Text = "Mouse Exited"
'displaying "mouse exited" in Textbox3 when the mouse pointer leaves the form
End Sub
End Class
good post......
ReplyDelete