Results 1 to 3 of 3

Thread: Cool Button

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Ohio
    Posts
    5

    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?

  2. #2
    zchoyt
    Guest
    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

  3. #3
    zchoyt
    Guest
    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
  •  



Click Here to Expand Forum to Full Width