Joey Morani
Joey Morani

Reputation: 26581

How to prevent fullscreen form covering the taskbar?

Does anyone know how I can prevent my C# winform covering/going on top of the taskbar? My form's border style has been set to "FixedToolWindow" which seems to cause this. I thought about reducing the height of the form, when the user makes the form maximized, but that wouldn't work as people may have different size taskbars.

Upvotes: 5

Views: 2361

Answers (1)

Rob Fonseca-Ensor
Rob Fonseca-Ensor

Reputation: 15621

The Screen class will give you both screen bounds and working area. The working area is the bounds minus the taskbar, so just set your form to be the same location as the Screen's WorkingArea

The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

Upvotes: 3

Related Questions