为单选按钮添加悬停颜色
Adding hovering color to radio buttons
我正在开发 winform 应用程序。我需要为单选按钮添加悬停颜色。我找不到任何事件处理程序。
我想在鼠标悬停在单选按钮上时更改单选按钮的颜色。
请告诉我如何实现。
提前致谢!!
尝试更改 backColor 属性。
例如,鼠标悬停事件:
private void radioButton1_MouseHover(object sender, EventArgs e)
{
this.radioButton1.BackColor = System.Drawing.Color.Yellow;
}
当鼠标悬停时,单选按钮的背景颜色会变为黄色。
和鼠标离开事件:
private void radioButton1_MouseLeave(object sender, EventArgs e)
{
this.radioButton1.BackColor = System.Drawing.Color.Empty;
}
单选按钮背景颜色将变回默认颜色。
然后,你会得到悬停效果。
祝你好运。
我正在开发 winform 应用程序。我需要为单选按钮添加悬停颜色。我找不到任何事件处理程序。
我想在鼠标悬停在单选按钮上时更改单选按钮的颜色。
请告诉我如何实现。
提前致谢!!
尝试更改 backColor 属性。
例如,鼠标悬停事件:
private void radioButton1_MouseHover(object sender, EventArgs e)
{
this.radioButton1.BackColor = System.Drawing.Color.Yellow;
}
当鼠标悬停时,单选按钮的背景颜色会变为黄色。
和鼠标离开事件:
private void radioButton1_MouseLeave(object sender, EventArgs e)
{
this.radioButton1.BackColor = System.Drawing.Color.Empty;
}
单选按钮背景颜色将变回默认颜色。
然后,你会得到悬停效果。
祝你好运。