How to Change an object's colour when the mouse pointer is in it ?

You can use the MouseEnter and MouseLeave events as in

Private Sub Button1_MouseEnter(sender As System.Object, e As System.EventArgs) Handles Button1.MouseEnter
    Button1.Tag = Button1.BackColor
    Button1.BackColor = Color.Blue
End Sub

Private Sub Button1_MouseLeave(sender As System.Object, e As System.EventArgs) Handles Button1.MouseLeave
    Button1.BackColor = Button1.Tag
End Sub

In this example I use the Tag property to save the original colour so it can be restored on MouseLeave.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.