full screen mode, but don't cover the taskbar

前端 未结 10 1328
旧巷少年郎
旧巷少年郎 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:27

    This is probably what you want. It creates a 'maximized' window without hiding the taskbar.

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    
        private void Form1_Load( object sender, EventArgs e )
        {
            FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            Left = Top = 0;
            Width = Screen.PrimaryScreen.WorkingArea.Width;
            Height = Screen.PrimaryScreen.WorkingArea.Height;
        }
    }
    

提交回复
热议问题