I want to change the back color of a label using RGB values. I can't figure out how?
I want to change the back color from 30, 30, 30 to 36, 36, 36 on hover and back to 30, 30, 30 when mouse stops hovering.
I want to change the back color of a label using RGB values. I can't figure out how?
I want to change the back color from 30, 30, 30 to 36, 36, 36 on hover and back to 30, 30, 30 when mouse stops hovering.
Based on your question, I'm assuming you mean when the mouse enters and leaves the WinForm label's region, as per John's comment. To do this, you would need to hook the label's MouseEnter and MouseLeave events. Below, I have assumes the label's name is "label1"
private void label1_MouseEnter(object sender, EventArgs e)
{
label1.BackColor = Color.FromArgb(36, 36, 36);
}
private void label1_MouseLeave(object sender, EventArgs e)
{
label1.BackColor = Color.FromArgb(30, 30, 30);
}