full screen mode, but don't cover the taskbar

前端 未结 10 1338
旧巷少年郎
旧巷少年郎 2020-12-05 19:38

I have a WinForms application, which is set to full screen mode when I login.

My problem is it\'s covering the Windows taskbar also. I don\'t want my application to

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 20:14

    If you have multiple screens, you have to reset location of MaximizedBounds :

    Rectangle rect = Screen.FromHandle(this.Handle).WorkingArea;
    rect.Location = new Point(0, 0);
    this.MaximizedBounds = rect;
    this.WindowState = FormWindowState.Maximized;
    

提交回复
热议问题