I am making a Windows Forms application. I want the forms height to increase after a button is pressed. How do I do this?
Asked
Active
Viewed 2.6k times
4
-
Related: *[Change form size at runtime in C#](http://stackoverflow.com/questions/13064350)* – Peter Mortensen May 12 '17 at 12:51
3 Answers
11
Use the Height
property. For instance:
this.Height = newHeight;

Uwe Keim
- 39,551
- 56
- 175
- 291

CrazyCasta
- 26,917
- 4
- 45
- 72
2
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;
}

AustinWBryan
- 3,249
- 3
- 24
- 42

CC Inc
- 5,842
- 3
- 33
- 64
1
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

Adam Plocher
- 13,994
- 6
- 46
- 79