I have a WinForms application (.NET 4) that should display either fullscreen or maximized without borders.
Using the following code in the event Form_Shown:
#if (DEBUG)
var debug = true;
#else
var debug = false;
#endif
this.Text = "";
this.ControlBox = false;
this.ShowInTaskbar = true;
this.TopLevel = true;
this.FormBorderStyle = FormBorderStyle.None;
if (debug) { this.Bounds = Screen.FromControl(this).WorkingArea; }
else { this.WindowState = FormWindowState.Maximized; }
If you look closely at the screenshot below, the upper and lower areas are cropped a few pixels. In addition, if it is maximized, the window still does not cover the taskbar.
Please note that I only have one monitor. No additional displays.
Any suggestions on how to solve the two above issues will be appreciated.

UPDATE: The above code works fine with forms without MenuStripor StatusStrip.