views:

905

answers:

3

Coming from many years of asp.net development back to a winforms application.

Looking for advice and tips on how to "style" winforms similar to how I would do with CSS/Master Pages in asp.net.

I am interested on how to update font/colors for certain types of controls in one place. How to maintain consistency for layouts.

Any pointers/articles are appreciated.

FYI...WPF is not an option for this project.

+2  A: 

You could create custom versions of the different standard controls you need, inheriting from the original versions but applying custom styles to the custom versions. This would give you a single place to change the styling of a component type. You could also have each of the controls take a style object as a parameter for system-wide styles.

Morten Christiansen
+1  A: 

Unless you're creating some sort of walk-up kiosk application I would advise against messing around with the look-and-feel of the Windows common controls in your application.

For a desktop application consistency with other Windows applications is usually considered more important that any design whims.

Richard Ev
The look and feel with be windows like. But there are many places were settings need to be applied consistently. One example that comes to mind is the grids. All need to have 4-6 settings applied consistently like alternate row colors.
B Z
Forms and UserControls in WinForms support inheritance, so you should be able to create base form classes in which you set these things up. Does that help?
Richard Ev
+1  A: 

Custom controls are the typical way of achieving this. If you have a label control you want to use over and over again, inherit from it and set your own properties.

While it might seem a bit tedious, its really the best way to do it with WinForms. WinForms wasn't designed for this, as WPF was.

Hope that helps!

1kevgriff