Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to change background color forecolor on mouse hover as we did in normal website but i want to do this in my winform..
Posted
Comments
Rockstar_ 24-Jul-12 3:24am    
Write the code for changing the background color in MouseHover event of the control.
Member 8233601 24-Jul-12 3:38am    
plz provide me code i m in need
Sandeep Mewara 24-Jul-12 8:06am    
What have you tried so far?

hi,


C#
private void panel1_Leave(object sender, EventArgs e)
        {
            panel1.BackColor = Color.Blue;
        }

        private void panel1_MouseEnter(object sender, EventArgs e)
        {
            panel1.BackColor = Color.Red;
        }
 
Share this answer
 
Firstly a piece of advise: Text speak and code demands normally wont get you far.
Vijay gave you all you needed to get moving.
From MSDN (after a google search on MouseHover Event Control)
gives us this site

C#
private void panel1_MouseHover(object sender, System.EventArgs e)
    {
        // Update the mouse event label to indicate the MouseHover event occurred.
        label1.Text = sender.GetType().ToString() + ": MouseHover";
    }

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousehover.aspx[^]

Hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900