How to make a UserControl with a custom DefaultBackColor?
- by Blorgbeard
When I right-click on my custom UserControl's BackColor property in the property-grid, then click Reset, I would like the BackColor property to change to (for example) Color.LightGreen, and the property value to appear un-bolded, to indicate that it is the default value.
Currently, I know I can do this:
public override void ResetBackColor() {
BackColor = Color.LightGreen;
}
Which works as far as setting it to LightGreen on reset. But it still appears bolded in the property-grid, indicating that the current value is not the default.
I notice that the Control class has a static read-only property, DefaultBackColor. Unfortunately, since it's static, I cannot override it.
Is there some way to get all the functionality I want?