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

前端 未结 3 1010
野趣味
野趣味 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 06:53

    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;
    }    
    

提交回复
热议问题