dotnet-api-docs
dotnet-api-docs copied to clipboard
Error with Screen.FromControls(this).WorkingArea;
#5480 private void ScreenshotAutoPlusUI_Load(object sender, EventArgs e) { Rectangle screenRect = Screen.FromControl(this).WorkingArea; this.DesktopBounds = screenRect; int heightSidePanelNeedsToBe = screenRect.Height - HeightOfAreAboveViewport; screenshotAutoTop_Panel.Height = HeightOfAreAboveViewport; screenshotAutoSide_Panel.Height = heightSidePanelNeedsToBe; this.TopMost = true; backgroundWorker1.WorkerSupportsCancellation = true; processUpdates_RTB.Text = "Process status: Opened."; } When I use the code above, the screenshotAutoSide_Panel ends up overlapping the search bar in the taskbar by a few pixels. But my taskbar isn't set to AutoHide. It shouldn't overlap at all; otherwise, what would be the point of having both the Bounds and WorkingArea properties? Indeed, when I used the debugger to see what screenRect was assigned to, the size was the same as the resolution of the monitor the panel appeared on.