zoukankan      html  css  js  c++  java
  • winform窗体程序最大化时遮挡屏幕任务栏的设置

         在程序设计中,我想使用无边框而且最大化。但是这样设置之后,应用程序往往会遮挡屏幕的任务栏。刚开始觉得遮挡任务栏的应用程序挺有意思,用着用着反倒觉得真是反人类啊。所以想着怎么改善这种遮挡任务栏的应用程序:

    通过验证:winform窗体的FormBorderstyle设置为none时,会出现遮挡任务栏;

                      winform窗体的controlbox设置为false也是会导致遮挡任务栏;

    最后按照网上的, 

        this.FormBorderStyle = FormBorderStyle.None;
             this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
             this.WindowState = FormWindowState.Maximized;

    但是发现还是遮挡任务栏,调试发现Screen.PrimaryScreen.WorkingArea.Width的值为1536,Screen.PrimaryScreen.WorkingArea.Height的值为864,遮挡任务栏.而替换为

             this.MaximumSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

    此时:Screen.PrimaryScreen.Bounds.Width的值依然为1536,Screen.PrimaryScreen.Bounds.Height值为864.依然是遮挡任务栏。

    笔记本电脑和台式机都测试了,都是这样,说明这种方法还是行不通。

       最后还是设置

    winform窗体的FormBorderstyle设置为FixedSingle, winform窗体的controlbox设置为true,然后再使用DMSkin类似于这样的皮肤控件进行美化。

  • 相关阅读:
    121. 122. 123. 188. Best Time to Buy and Sell Stock *HARD* 309. Best Time to Buy and Sell Stock with Cooldown -- 买卖股票
    from __future__ import absolute_import
    sql之left join、right join、inner join的区别
    Eclipse workspace 被占用问题
    JavaScript SetInterval与setTimeout使用方法详解
    提示框3秒钟后自动消失
    页面加载及取消加载
    分层总结
    java中的注释
    canvas画图
  • 原文地址:https://www.cnblogs.com/cumt-cwp/p/8496059.html
Copyright © 2011-2022 走看看