How do I make a WinForms app go Full Screen

前端 未结 9 1493
你的背包
你的背包 2020-11-22 11:20

I have a WinForms app that I am trying to make full screen (somewhat like what VS does in full screen mode).

Currently I am setting FormBorderStyle to <

9条回答
  •  梦谈多话
    2020-11-22 11:57

    To the base question, the following will do the trick (hiding the taskbar)

    private void Form1_Load(object sender, EventArgs e)
    {
        this.TopMost = true;
        this.FormBorderStyle = FormBorderStyle.None;
        this.WindowState = FormWindowState.Maximized;
    }
    

    But, interestingly, if you swap those last two lines the Taskbar remains visible. I think the sequence of these actions will be hard to control with the properties window.

提交回复
热议问题