I have a number of buttons on my frame and I want to show which one is selected by showing a background color. The only problem is that this background color is only visible when the mouse is hovering over the button, otherwise the button will be clear white.
Overriding the MouseEnter and MouseLeave events didn't help.
The button is inherited from the standaard Windows Forms Button and has the following method to show if it's selected:
public void SetFocus(bool focused)
{
if (focused)
this.BackColor = SelectColor;
else this.BackColor = color;
}
The SelectColor is a static yellow color (to indicate the button is selected) and color is a private color stored in the class holding the color the button has when it's not selected.
Does anyone know how to show the background color, even when not hovering over the button?