winform实现动态按钮

 private void button6_MouseMove(object sender, MouseEventArgs e)
        {
            button6.ImageAlign = ContentAlignment.MiddleLeft;//鼠标移动到button6时改变图片位置
        }
        private void button6_MouseLeave(object sender, EventArgs e)
        {
            button6.ImageAlign = ContentAlignment.MiddleCenter;//鼠标离开时改变button6图片位置
        }

  有向右移动的效果

 

 

转载于:https://www.cnblogs.com/xuekai-to-sharp/p/3559363.html

你可能感兴趣的:(winform实现动态按钮)