C#设置按钮三态背景图片

1.闪电事件,注意添加手动或者点击按钮->属性中的闪电->下面对应各种事件

在上面:

private void button1_MouseHover(object sender, EventArgs e)
{
button1.BackgroundImage = Properties.Resources.Image3;//鼠标指上去则使用Image3
}

点击:--直接双击按钮即可

private void button1_Click(object sender, EventArgs e)
{

}

离开:

private void button1_MouseLeave(object sender, EventArgs e)
{
if (Button1Statue) //鼠标移开,返回原来状态
{
button1.BackgroundImage = Properties.Resources.Image1;
}
else
{
button1.BackgroundImage = Properties.Resources.Image2;
}
}

posted @ 2014-12-05 14:29  fx427103  阅读(787)  评论(0编辑  收藏  举报