How do I programmatically resize a Windows Form?
You can programmatically resize a form by setting the Height and Width properties at runtime.
In C#:
MyForm.Width = 640;
MyForm.Height = 480;In Visual Basic .NET:
MyForm.Width = 640
MyForm.Height = 480Alternately, you can set both properties at the same time by changing the form's Size property.
In C#:
MyForm.Size = new Size(640, 480);In Visual Basic .NET:
MyForm.Size = New Size(640, 480)
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 05/14/09
Comment or report problem with topic
