限制窗体大小

实现代码:

  

知识运用:

  窗体的Width属性 Height属性 用于获取或设置窗体的宽度(高度)  属性值以像素为单位

  和FormBorderStyle属性   用于 获取或设置窗体的边框样式  属性值为FormBorderStyle枚举值

  

 实现代码:

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Width = 400;
            this.Height = 300;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
        }

  

原文地址:https://www.cnblogs.com/feiyucha/p/10092416.html