11.8.05

Borderless Windows Form and Maximize

Bug or feature?

When you maximize a borderless form it will cover the whole screen as expected, but it will also cover the Task bar. Although I haven't found any documentation that states that's by design many claim so...

If you don't like this behaviour you can manually "hard code" maximum form size when it's maximized through MaximizedBounds form property.

Add this code to your form and you're all set... Enjoy!


public new FormWindowState WindowState
{
    
get
    
{
        
return base.WindowState;
    
}
    
set
    
{
        
if (value == FormWindowState.Maximized)

        {
            
this.MaximizedBounds =
               SystemInformation.WorkingArea;
        
}
        
base.WindowState = value;                
    
}
}