Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Changing backcolor of buttons

$
0
0

Hello,

I have 26 buttons in a GroupBox on a form.  I want to use the MouseHover event to change the backcolor of a button when the user hovers over the button and the MouseLeave event to change the color back to it's original color. This, I'm able to do, but I have to do it 26 times for each button. Is it possible accomplish this with just one code or a code that will handle this for all buttons but only for the button the user is hovering or leaving? My button names are as such: BtnA, BtnB, BtnC etc...

Any help would be greatly appreciated.

Mike


Mike


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>