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

前端 未结 3 1011
野趣味
野趣味 2021-01-19 06:36

I am making a Windows Forms application. I want the forms height to increase after a button is pressed. How do I do this?

3条回答
  •  走了就别回头了
    2021-01-19 07:00

    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

提交回复
热议问题