Implementing a company styleguid

  • Thread starter Thread starter Dudio.nl
  • Start date Start date
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
 
For desktop application, I would suggest you should avoid enforcing a style
via code, instead relying on theming your users desktop so that basic style
or theme of windows and applications is picked up. Restricting themes is a
much better way of controlling your app style, and its easier to cater for
disabled users who need additional flxibility over colour, size etc. This
can still form part of a company wide styleguide.

http://www.microsoft.com/resources/...s/en-us/display_customize_theme.mspx?mfr=true

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top