|
-
Nov 15th, 2001, 03:24 PM
#1
Thread Starter
New Member
Cool Button
In Visual Studio.net when you move the mouse over a menu option the color changes. Does any body know how to change the color of a button when the mouse is rolled over a button?
-
Nov 18th, 2001, 10:33 PM
#2
Goto the code of the form that the button is on.
There are two combo boxes at the top of the code.
Select the button from the combo box on the right.
On the left select MouseEnter.
VB will produce a Sub that looks like this:
Private Sub Button1_MouseEnter(ByVal sender as Object, ByVal e as System.EventArgs) Handles Button1.MouseEnter
End Sub
The code in this sub will be fired when the mouse goes over the button, so enter the code so it looks like this:
Private Sub Button1_MouseEnter(ByVal sender as Object, ByVal e as System.EventArgs) Handles Button1.MouseEnter
Button1.BackColor = Color.Blue
End Sub
Then Repeat for MouseLeave
Private Sub Button1_MouseEnter(ByVal sender as Object, ByVal e as System.EventArgs) Handles Button1.MouseEnter
Button1.BackColor = SystemColor.Control
End Sub
-
Nov 18th, 2001, 10:36 PM
#3
I meant
Private Sub Button1_MouseLeave(ByVal sender as Object, ByVal e as System.EventArgs) Handles Button1.MouseLeave
Button1.BackColor = SystemColor.Control
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|