C# WinForm 全屏,不带任务栏,带任务栏

WinForm 全屏 带任务栏 不带任务栏

 

不带任务栏

    public partial class Form1 : Form
    {
        public Form1()
        {
            //可交换顺序(方式1)
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            InitializeComponent();
            //可交换顺序(方式2)
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //不可交换顺序(方式3)
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
        }
    }

  

带任务栏

    public partial class Form1 : Form
    {
        public Form1()
        {

            InitializeComponent();

        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //不可交换顺序
            this.WindowState = FormWindowState.Maximized;
            this.FormBorderStyle = FormBorderStyle.None;
        }
    }

  

posted @ 2020-08-21 16:53  爱恋的红尘  阅读(1866)  评论(0编辑  收藏  举报