Set minimum window size in C# .NET

Since Size is a struct, you can’t do that.
Instead, you need to assign a new Size value to the property, like this:

this.MinimumSize = new Size(800, 600);

EDIT Your compiler is wrong; it’s confusing the Size class with the Control.Size property.

To work around this unjust error, you need to qualify the type with a namespace:

this.MinimumSize = new System.Drawing.Size(800, 600);

Or you just forgot using System.Drawing.

Leave a Comment