窗口全屏不覆盖状态栏利用(桌面的大小分辨率表示)Screen.PrimaryScreen.WorkingArea.Width

private void Form1_Load(object sender, EventArgs e)
        {
            this.Left = 0;
            this.Top = 0;
            int wx=Screen.PrimaryScreen.WorkingArea.Width;//获得桌面的大小
            int wy=Screen.PrimaryScreen.WorkingArea.Height;

            //获得当前程序的相对路径

            mypath = Application.StartupPath;

            this.Width = wx;
            this.Height = wy;

}

猜你喜欢

转载自blog.csdn.net/lazy20018/article/details/4430845