【winform界面美化】解决Winform窗体最大化遮盖系统任务栏问题

时间:2019-09-11  来源:WinForm  阅读:

今天将一个Winform窗体设计成最大化后,运行发现它遮盖了系统任务栏,经多次测试发现原来是同时禁用了最大化按钮且设置窗体边框样式为FormBorderStyle.FixedSingle才会出现这种情况:
 
private void Form1_Load(object sender, EventArgs e)
{
    this.MaximizeBox = false;
    this.FormBorderStyle = FormBorderStyle.FixedSingle;
    this.WindowState = FormWindowState.Maximized;
}

调整下顺序即可解决:

 
private void Form1_Load(object sender, EventArgs e)
{
    this.WindowState = FormWindowState.Maximized;
    this.MaximizeBox = false;
    this.FormBorderStyle = FormBorderStyle.FixedSingle;           
}

没想到吧其实就是顺序问题了,这个小编以前在做一些php程序时也因碰到顺序问题导致页面不正常了像js也有碰到过了。

【winform界面美化】解决Winform窗体最大化遮盖系统任务栏问题

http://m.bbyears.com/asp/67599.html

推荐访问:winform教程菜鸟
相关阅读 猜你喜欢
本类排行 本类最新