I have a form that FormborderStyle is none put it, after I create forms like resizing the original form, but its default size does not change when scaled
how to change the default size of the form?
Thank you !

Dani AI

Generated

Short answer: resizing one form instance at runtime changes that instance only — it does not rewrite the size hard-coded by the form class/designer for future instances. That explains why new forms keep the old “default” size even after the original was resized. This addresses and ’s runtime/design distinction and builds on the simple Width/Height hint from and .

Practical fixes (pick one that fits the workflow):

  • Assign the desired size when creating each new form (use Manual start position if location is important):
var f = new ChildForm();
f.StartPosition = FormStartPosition.Manual;
f.Size = this.Size;       // copy size from the resized form
f.Location = new Point(this.Left + 20, this.Top + 20);
f.Show();
  • Keep a shared “default size” the form class reads at construction and update that value when the template form is resized:
public class ChildForm : Form
{
    public static Size DefaultForNew = new Size(800, 600);
    public ChildForm()
    {
        InitializeComponent();
        this.Size = DefaultForNew;
    }
}
  • For a stricter, designer-free default, override the protected DefaultSize property in a custom form subclass (note: InitializeComponent may still set Size if the designer wrote one):
protected override Size DefaultSize { get { return new Size(900, 700); } }

Troubleshooting notes and cautions:

  • FormBorderStyle = None affects chrome vs. client area; use ClientSize when the interior area matters.
  • AutoScaleMode (Font/DPI/None) affects control scaling, not the class default Size — set it deliberately.
  • MinimumSize/MaximumSize and StartPosition can interfere with expected results.
  • To persist a chosen size across app runs, save it to settings (Properties.Settings) and apply it on construction.

This response ties the runtime/design distinction back to the thread and offers immediately actionable code and options for making a resized form the “default” for future instances.

Recommended Answers

All 4 Replies

The form has a Width and Height property. Change these appropriately.

Do you mean during runtime phase or during design phase?

Runtime phase or during design phase, makes no difference.

You can change the size of the form using width and height attributes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.