Hi guys. Newbie question for ya:
I'm trying to make a simple mousehover effect for a button called btnAdd which changes the background and foreground colors of the button when you move the mouse over it and then reverts back to normal when you leave it. Here's what I've got so far:
It just seems to me like there should be a simpler way. I have to do this for a number of buttons and it makes my code look cluttered. Also, the example .exe that my professor included with the lab assignment shows the effect happening instantly, whereas mine seems to take a small time loading.
I'm using Visual Studio .NET 2003
I'm trying to make a simple mousehover effect for a button called btnAdd which changes the background and foreground colors of the button when you move the mouse over it and then reverts back to normal when you leave it. Here's what I've got so far:
VB.NET:
Private Sub btnAdd_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.MouseHover
Me.btnAdd.BackColor = System.Drawing.Color.Firebrick
Me.btnAdd.ForeColor = System.Drawing.Color.White
End Sub
Private Sub btnAdd_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.MouseLeave
Me.btnAdd.BackColor = System.Drawing.Color.RosyBrown
Me.btnAdd.ForeColor = System.Drawing.Color.Black
End Sub
I'm using Visual Studio .NET 2003