1.点击触发置位,松开复位
- 可以给按钮添加不同的背景图片backgroundImage做到置位和复位的不同效果,但在按钮属性中要注意:
1、按钮控件不要有边框 :属性FlatAppearance.BorderSize设置为0
2、BackgroundImageLayout设置为zoom平铺
3、FlatStyle设置为Flat
//利用鼠标按下和松开事件分别插入图片
private void button1_MouseDown(object sender, MouseEventArgs e)
{
//插入按下的图片
button1.BackgroundImage = Properties.Resources