Maximized screen ignores taskbar

If you are using FormBorderStyle.None then it is very simple to make sure it doesn't cover the taskbar when maximized:

this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

It will probably work for other border styles and is probably the cleanest way to ensure your form does not cover the taskbar.


One thing I left out of the description--I'd turned off the maximize button. When I tested turning that property back on, the task bar showed up again. Apparently it assumes if you don't want a maximize button you are creating a kiosk-style application where you don't want your users to see anything but the application screen. Not exactly what I'd expect, but works I guess.


Set the form border to None before making it maximized.

This code will work in a single monitor:

private void Form1_Load(object sender, EventArgs e)
{
    this.FormBorderStyle = FormBorderStyle.None;
    this.WindowState = FormWindowState.Maximized;
}

I haven't tested the dual monitor scenario since i don't have this at this moment. :P

EDIT: I didn't get it "Maximized Screen Ignores Taskbar". What does Ignores mean?

Do you want your form to cover the taskbar and fill the entire screen?