How do I resize a Windows Forms form in C#?

女生的网名这么多〃 提交于 2019-12-02 02:22:30
CrazyCasta

Use the Height property. For instance:

this.Height = newHeight;

You can just increase the form height value by a specified amount on the button click:

private void button1_Click(object sender, EventArgs e)
        {
            int amountToIncrease = 10;
            this.Height += amountToIncrease;
        }    
this.Size = new Size(175, 125);

or

this.ClientSize = new Size(175, 125);

From MSDN: The size of the client area of the form is the size of the form excluding the borders and the title bar.

http://msdn.microsoft.com/en-us/library/9278sfx2(v=vs.80).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!