Search code examples
vb.netwinformsfullscreenformborderstyle

Form with FormBorderStyle none, becomes fullscreen when maximized


I have a form with FormBorderStyle property set to None and I have my own panels acting as the title Bar so that my application looks good.

But, the problem is that when the application is maximized, it covers the task bar also, which I don't want.

Any idea why is this happening and what is the solution for it? Please help.


Solution

  • This is the default behavior with FormBorderStyle set to None.

    To get it the way you want you can set the MaximizedBounds-property of the Form to match the WorkingArea:

    Me.MaximizedBounds = Screen.FromHandle(Me.Handle).WorkingArea