C# 2005:从窗体的标题栏中删除图标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/784717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C# 2005: Remove icon from the form's title bar
提问by ant2009
A client has asked me to remove the icon from the form's title bar. As they don't want to display any icon. But this me guessing as when I click on the icon property you have to browse to some icon.
一位客户要求我从表单的标题栏中删除该图标。因为他们不想显示任何图标。但这我猜测,因为当我单击图标属性时,您必须浏览到某个图标。
采纳答案by Stanislav Kniazev
Set ShowIconProperty of the form to Falseto see if that's what your client wants.
将表单的 ShowIcon属性设置为False以查看这是否是您的客户想要的。
回答by Ramesh Soni
Set
放
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
回答by yinyueyouge
There are two ways.
有两种方。
First is to create an empty Icon file and then Select Form -> Right Click -> Goto Properties -> Goto Icon -> Select your file.
首先是创建一个空的 Icon 文件,然后选择 Form -> Right Click -> Goto Properties -> Goto Icon -> Select your file。
The other approach is to set FormBorderStyleof the form to FormBorderStyle.SizableToolWindowor FormBorderStyle.FixedToolWind
另一种方是,以集合FormBorderStyle形式的FormBorderStyle.SizableToolWindow或FormBorderStyle.FixedToolWind
And one more way is to set ShowIconproperty to be false.
另一种方是将ShowIcon属性设置为false。
回答by Fredrik M?rk
You can set ControlBox = false. However, that will remove not only the icon but also maximize and minimize buttons from the title bar.
您可以设置 ControlBox = false。但是,这不仅会删除图标,还会删除标题栏中的最大化和最小化按钮。
回答by tmsdajpa
There appears to be an updated process. Following the steps in the selected answer doesn't direct me to an option to upload an icon. That option can be found on Microsoft's site: https://support.office.com/en-us/article/add-a-custom-title-or-icon-to-a-database-0e43e135-dd0d-4451-84ea-4f547e14480e
似乎有一个更新的过程。按照所选答案中的步骤操作并不会引导我选择上传图标的选项。该选项可以在 Microsoft 的网站上找到:https: //support.office.com/en-us/article/add-a-custom-title-or-icon-to-a-database-0e43e135-dd0d-4451-84ea -4f547e14480e
回答by Aqeel Shamsudheen
You can also try this:
你也可以试试这个:
this.Icon = null;
回答by Momoro
Icon > False
This COULD be a good approach, but these are good too:
这可能是一个很好的方,但这些也很好:
this.Icon = null;
//Or
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
//Or
Select Your Form -> Right-Click -> Properties -> Icon -> Select file
That's all I have for this, I hope this helps you.
这就是我的全部内容,希望对您有所帮助。