I want to remove icon from windows MDI child form

元气小坏坏 提交于 2019-12-02 19:50:36

问题


There is same problem related with icon. I am satisfy with your answer that seticon property to false. But my form is child of MDI form, then this problem is remain same that icon is not remove. Can you help me.


回答1:


Yes, this is a "feature" of the Windows MDI implementation. 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.

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. 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.




回答2:


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;
    }
}


来源:https://stackoverflow.com/questions/2872740/i-want-to-remove-icon-from-windows-mdi-child-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!