Reputation:
First the resize window button doesn't want to work ,for some reason.
private void FullScreenButton_Click(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.WindowState = FormWindowState.Maximized;
}
if (this.WindowState==FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
}
}
And even if i make the form maximized from the VS form properties from this http://postimg.org/image/mmy9r7qu9/ ,the form turns into this http://postimg.org/image/kzeyrb9fb/ .What is going on?
Upvotes: 0
Views: 118
Reputation: 109
You can also see an image about this option in: https://www.mediafire.com/view/nmnf8wcjsl1zi6z/WindowState.bmp
And you can try this for a "Button_Click":
private void FullScreenButton_Click(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.WindowState = FormWindowState.Maximized;
}
else
{
this.WindowState = FormWindowState.Normal;
}
}
Upvotes: 1
Reputation: 1
You are negating the first if-statement with the second if-statement, try using an else-if.
private void FullScreenButton_Click(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.WindowState = FormWindowState.Maximized;
}
else if (this.WindowState==FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
}
}
As for the Maximized sizing issue, do you have the Form's MaximumSize property set to "0,0" or some other value that could be limiting it's maximum size?
Upvotes: 0