.Net DefaultValueAttribute on Properties

The DefaultValueAttribute does not set the property to the value, it is purely informational. The Visual Studio designer will display this value as non-bold and other values as bold (changed), but you’ll still have to set the property to the value in the constructor.

The designer will generate code for the property if the value was set by the user, but you can remove that code by right clicking on the property and clicking Reset.

Leave a Comment