Question

I dock the taskbar to the left, which causes many windows to open underneath the taskbar.

None of the System.Windows.Form.FormStartPosition values take into account the taskbar except for Manual. Is this by design? It's frustrating. I want to respect the default monitor and window position values that the OS should enforce.

Was it helpful?

Solution

Well, if WinForms doesn't do this automatically, you may have to set this manually.

You'd have to use System.Windows.Forms.Screen.PrimaryScreen.WorkingArea to get the area of the screen without the taskbar, and use that Rectangle to compute the startup area for the form manually, and set it as the Form's Bounds property. (Make sure the form is using FormStartPosition.Manual).

OTHER TIPS

I think there is no .NET way to do that. I don't see any reasons to have such one.

You can locate taskbar position and put your form there manually.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top