I created a Form. In form load i called a method Maximize()
.
private void Maximize()
{
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;
}
I created a button on right top corner which restore/Maximize the form, which calls the Maximize()
or Restore()
method where ever necessary by suign some if and else commands.
private void Restore()
{
this.FormBorderStyle = FormBorderStyle.Sizable;
this.WindowState = FormWindowState.Normal;
}
As one may guess, my form starts as a full screen window. When i click the restore button, it restores and then if I again click it, it maximizes again. But as I continue the process, Maximized form size keeps on increasing. I can see that because my Restore button, kept on the right top corner, keeps on hiding on every subsiquent maximize of the form but nomal form size is as it should be.
My question can be confusing, so let me know if its not clear, and also I can upoad the screen shots of the problem.
Thanks.
label1.Text = this.Size.ToString();
I'm guessing it's not getting larger. – LarsTech