Set same icon for all my Forms

前端 未结 8 1519
一向
一向 2020-12-08 19:31

Is there any way to set the same icon to all my forms without having to change one by one? Something like when you setup GlobalAssemblyInfo for all your project

8条回答
  •  隐瞒了意图╮
    2020-12-08 19:59

    Alternative to setting in the constructor is overriding the Owner property, and taking the icon of the owner form.

    public new Form Owner {
        set {
            this.Icon = (value == null ? null : value.Icon);
            base.Owner = value;
        }
    
        get {
            return base.Owner;
        }
    }
    

提交回复
热议问题