Multiple UserControl Issues
I want to derive some control of the base .net WinForm controls (e.g. TextBox) in order to set the look&feel of the control once, and then reuse this derived control throughout my application. This way, if I want to change, lets say, the colour, I only need to go to the derived control, change the colour and all the textboxes should have the new colour. (Unless the forms themselves specify a different colour)
That's the theory.
In practice I'm struggling to make this work (in VS2005).
If I drag this control onto the form once, everything works fine and according to theory.
However, as soon as I drag the control onto the form a second time, somehow the form detects the color of the control and hardcodes it into the form designer code. The effect of this is that if I then go and change the derived control's colour, it is not reflected in the form when I run the application.
A workaround is to use composition instead of inheritance but that is more work.
Can anyone shed some light on the subject?