得到鼠标焦点后自动放大的按钮

Posted on 2018-12-18 11:41  努力成长静待花开  阅读(341)  评论(0编辑  收藏  举报

实现效果:

  

知识运用:

  按钮的Width HeightLocation属性

实现代码:

        private void button1_MouseEnter(object sender, EventArgs e)
        {
            button1.Width =120;
            button1.Height = 75;
            button1.Font = new Font("楷体",17);
            button1.Location = new Point((Width-button1.Width)/2,(Height-button1.Height)/2);
        }