Thread: How to do a mouse over event on a button?

  1. #1
    Registered User
    Join Date
    Feb 2005

    How to do a mouse over event on a button?

    you know how you would do something like
    private void button2_Click()  {      }
    What would you do for a mouse over? I want to do a mouse over on button2 and then put it code to srt the background color

    EDIT: I figured it out.

    In Microsoft Visual C# 2005 express, click on your button you have created, and goto the properties for that specific item. click on bgcolor, and then click on the lightening bolt to see what events are avalible. Then add your code to change the color, on MouseEnter and on MouseLeave to change it back.
    Last edited by GUIPenguin; 07-06-2006 at 10:28 AM.

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    between photons and phonons
    I'd suggest you also take a look at "Windows Form Designer generated code" region in de Form.Designer.cs file.

    If you understand that you'll be able to do all those things even when not working with a really good IDE like Visual Studio. + it can be usefull to see what is exactly going on below all the "drag, drop , click" reality that Visual Studio offers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 12-08-2008, 07:13 PM
  2. Code for holding down right mouse button
    By Bill83 in forum Windows Programming
    Replies: 2
    Last Post: 03-04-2006, 07:28 PM
  3. Looking at current mouse button state
    By Lifedragn in forum C# Programming
    Replies: 4
    Last Post: 12-02-2005, 06:52 AM
  4. Making a mouse hover button, API style
    By hanhao in forum C++ Programming
    Replies: 1
    Last Post: 05-27-2004, 06:17 AM