The form has a minimum size after restoring from a minimum state

I added the ClientSize window to the application settings and DataBindings in the properties window to save the size of the form after it is closed. And it worked. But when I minimize the shape and then activate it, it has a minimum size. Is this a mistake, or am I doing something wrong.

  • Create a new project (WindowForm application)
  • Open the window form of the window of the form Form1
  • In the application settings, select PropertyBinding
  • Add Location Binding and ClientSize
  • Run
  • Expand and then Restore
+7
source share
2 answers

I found the answer in this one. Thus, in order to save size and location without side effects, you need to remove the binding and save the application settings manually.

private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.Size = this.Size; Properties.Settings.Default.Location = this.Location; Properties.Settings.Default.Save(); } private void Form1_Load(object sender, EventArgs e) { this.Size = Properties.Settings.Default.Size; this.Location = Properties.Settings.Default.Location; } 
+3
source

Poor combinations of docking, filling, and auto-size between the form, controls, and sub-controls can have this effect.

0
source

All Articles