I am using Visual Studio, and created a new Windows Application in C#, that uses WinForms.
I took the Form that was created with the project, and set the .FormBo
Winforms applies an minimum size constraint to a form that's based on keeping the caption bar usable. Even if the form doesn't have one, a quirk that most programmers call "bug".
You can however still override the final size by setting the ClientSize property in an event handler for the Load event. Do beware the need to rescale the window on a machine with a different video DPI setting, you do not want to hard-code the size. Best way is to resize it based on the position of a control. For example:
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
this.ClientSize = new Size(
this.ClientSize.Width,
OKButton.Bottom + OKButton.Margin.Bottom
);
}
With the assumption that a control named OKButton is the bottom one. Tweak as necessary.