简体   繁体   English

我想从Windows MDI子窗体中删除图标

[英]I want to remove icon from windows MDI child form

There is same problem related with icon. 图标也有同样的问题。 I am satisfy with your answer that seticon property to false. 我对您的回答感到满意,因为seticon属性为false。 But my form is child of MDI form, then this problem is remain same that icon is not remove. 但是我的表单是MDI表单的子,那么这个问题就不会删除图标。 Can you help me. 你能帮助我吗。

Yes, this is a "feature" of the Windows MDI implementation. 是的,这是Windows MDI实现的“功能”。 Design guides require the child form to have an icon so it is easy for the user to see what child was maximized and where to click to activate the system menu. 设计指南要求子窗体具有图标,以便用户轻松查看最大化了哪个子窗体以及在何处单击以激活系统菜单。 The Windows Forms designer should have disabled the "ShowIcon" property and force it True but it can't because it doesn't know yet that the form will become an MDI child. Windows窗体设计器应该已禁用“ ShowIcon”属性并强制将其设置为True,但这不能,因为它尚不知道该窗体将成为MDI子级。

You'll have to work around it. 您将不得不解决它。 One possibility is using a 1x1 icon that's transparent so it won't be visible when the child form is maximized. 一种可能是使用透明的1x1图标,以便在子窗体最大化时不可见。 It is however not an ideal fix, the form's caption text will be shifted to the right. 但是,这不是理想的解决方法,表单的标题文本将向右移动。 The path of least resistance is to simply create an icon for the form. 阻力最小的途径是简单地为表单创建一个图标。

As described here you can make such item invisible: 如此处所述您可以使此类项目不可见:

private void MenuStrip_ItemAdded(object sender, ToolStripItemEventArgs e)
{
    if (e.Item.Text == "")
    {
        e.Item.Visible = false;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM