OK, so, what is the deal with properties that cannot be set to a default in a "base" class?
For example, I have a base Button class, MyButton. When I drop MyButton on a form, it sets the UseVisualStyleBackColor to true. Well, since this is a new property with 2.0, the designer seems to want to stick a line of code in there setting it to true. I've been going through all my base classes and setting defaults and I want it to default to false ... Can't do it with this Property (same with a few others too).
I did all the usual right things ... set it to false in the constructor of MyButton and set a property with [DefaultValue(false)] ... the designer still sets it to true. So I tried a few other tricks ... the only things that worked were specifically setting it to false, either by returning false in the get, or setting the base.UseVisualStyleBackColor = false in the set. Not very good, because then it couldn't be set at all in the PropertySheet (but maybe that doesn't matter ... no one would probably be overriding only a few instances of a class).
Maybe I should just let it default to true? Any downsides to that? I'm just not sure we want to enable visual styles in our app to begin with. Does anyone have a solution or comments?
~~Bonnie