Form has minimum size after restoring from minimize state
I Added ClientSize to Application Settings and DataBindings in Properties window, in order to save size of the form after it was closed. And that worked. But when I minimize form and then activate it back, it has minimum size . Is it a bug or I'm doing something wrong
I found answer in this topic. So to save size and location without side effects , need to remove binding and save application settings by hand
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;
}
表单,控件和子控件之间的停靠,填充和自动调整的不良组合可能会产生这种效果。
链接地址: http://www.djcxy.com/p/4972.html下一篇: 从最小化状态恢复后,表格具有最小尺寸