Change form size at runtime in C#

The Solution to Change form size at runtime in C# is


You cannot change the Width and Height properties of the Form as they are readonly. You can change the form's size like this:

button1_Click(object sender, EventArgs e)
{
    // This will change the Form's Width and Height, respectively.
    this.Size = new Size(420, 200);
}

~ Answered on 2012-10-25 08:23:37


Most Viewed Questions: