D
Dudio.nl
[sorry for 'crossposting', but m.p.d.f.w.controls has very low
activity]
Hi,
the company I'm working has got a styleguide, which we use for
web-projects. The guide should also be applicable for Windows
applications. Basicly it tells you the color, font, margins etc for
various controls. What is a suitable way for me to implement this
styleguide for our C# windows forms development?
I was thinking about creating custom My<Control> classes, like
MyButton; MyLabel etc. and setting approriate property-values in the
overridden constructor. This approach is flawed though, if you use the
VS designer. If I set the ForeColor of a MyLabel, to Color.Blue for
instance, and add that to a Form, in the generated code section it puts
a statement setting the ForeColor. I understand this is because the
designer compares the value of the property to the default value (which
is Color.Black). No problems sofar, but if I would decide to change the
control's color to Color.Red, then none of my already added MyLabel
controls gets his ForeColor changed. To prevent this behaviour, I could
override the ForeColor property. In this case that sollution would be
sufficient, but not all properties I would like to change the default
value for, are overridable.
Is there a common approach for this?
tia
Frank Guchelaar
activity]
Hi,
the company I'm working has got a styleguide, which we use for
web-projects. The guide should also be applicable for Windows
applications. Basicly it tells you the color, font, margins etc for
various controls. What is a suitable way for me to implement this
styleguide for our C# windows forms development?
I was thinking about creating custom My<Control> classes, like
MyButton; MyLabel etc. and setting approriate property-values in the
overridden constructor. This approach is flawed though, if you use the
VS designer. If I set the ForeColor of a MyLabel, to Color.Blue for
instance, and add that to a Form, in the generated code section it puts
a statement setting the ForeColor. I understand this is because the
designer compares the value of the property to the default value (which
is Color.Black). No problems sofar, but if I would decide to change the
control's color to Color.Red, then none of my already added MyLabel
controls gets his ForeColor changed. To prevent this behaviour, I could
override the ForeColor property. In this case that sollution would be
sufficient, but not all properties I would like to change the default
value for, are overridable.
Is there a common approach for this?
tia
Frank Guchelaar