实现效果:
知识运用:
MouseMove事件
ImageAlign属性 //获取或设置按钮控件上的图像对其方式
//默认为MiddleCenter 属性值为ContentAlignment枚举值之一
实现代码:
private void button1_MouseMove(object sender, MouseEventArgs e) { button1.ImageAlign = ContentAlignment.MiddleLeft; } private void button1_MouseLeave(object sender, EventArgs e) { button1.ImageAlign = ContentAlignment.MiddleCenter; }