Form Visual Studio covering the Windows taskbar or standing behind the taskbar

I have an application that I use the property FormBorderStyle = none, but this happening that in windows 10 my status bar (statusBar) that is at the bottom is behind the taskbar and in windows 7 ends up covering , what can I do to adjust the correct size?

Author: CypherPotato, 2018-05-30

1 answers

Try to set the maximum size for the window to be the safe area of the desktop . You will need to include the two references:

using System.Drawing;
using System.Windows.Forms;

And put these procedures at the time of loading Form:

Rectangle workingAreaRect = Screen.WorkingArea;
Size workingAreaSize = workingAreaRect.Size;

Form1.MaximumSize = workingAreaSize;
Form1.TopMost = false; // faz com que o Form não seja exibido na frente da Taskbar

These methods above will cause the size of Form to extend to the safe area of the monitor

 1
Author: CypherPotato, 2018-05-30 03:53:16