Maximized screen ignores taskbar

前端 未结 8 1745
刺人心
刺人心 2020-12-20 16:53

I have a form I set to Maximized, but for some reason it\'s ignoring the taskbar and maximizing to the entire screen. Is that typical? Is there a workaround?

8条回答
  •  情深已故
    2020-12-20 17:13

    Taskbar can be docked at left, top, bottom, right side. If you want maximized window without overlayed taskbar, use this code:

    
    ...cut...
      public partial class Form2 : Form
        {
            public Form2()
            {
              // set default start position to manual  
              this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; 
    
    
              // set position and size to the Form.  
              this.Bounds = Screen.PrimaryScreen.WorkingArea; 
    
    
          ....
              InitializeComponent();
            }
    
    ...cut...
    

提交回复
热议问题