Keep your filthy designer hands off my property values!
Is there an attribute I can set on my control's开发者_开发技巧 property to prevent the designer-generated code from ever setting a value to it?
http://msdn.microsoft.com/en-us/library/system.componentmodel.designerserializationvisibilityattribute.aspx
This looks useful.
The BrowsableAttribute
will remove it from the property grid, if you provide false
to the constructor:
[Browsable(false)]
If you set it with a default value, this value won't be serialized by the designer:
[DefaultValue("MyDefaultValue")]
精彩评论