Public Class Form1

    Private ObjName As String

    Private EventMsg As String

    Private Sub commonHandler(ByVal Obj As System.Object, ByVal ev As System.EventArgs)

        ObjName = Obj.ToString()

        EventMsg = ev.GetHashCode.ToString

        Label3.Text = ObjName

        Label4.Text = EventMsg

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        commonHandler(sender, e)

    End Sub

 

    Private Sub Button5_BackColorChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.BackColorChanged

        commonHandler(sender, e)

    End Sub

 

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Me.Button5.BackColor = Color.Chocolate

    End Sub

 

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

        Me.Close()

    End Sub

 

    Private Sub Button2_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.MouseHover

        commonHandler(sender, e)

    End Sub

 

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

        commonHandler(sender, e)

    End Sub

 

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

        Me.Button6.ForeColor = Color.Goldenrod

    End Sub

 

    Private Sub Button6_ForeColorChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button6.ForeColorChanged

        commonHandler(sender, e)

    End Sub

 

    Private Sub Button4_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.EnabledChanged

        commonHandler(sender, e)

    End Sub

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Me.Button4.Enabled = False

    End Sub

End Class