Reputation: 9453
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.
Upvotes: 8
Views: 4097
Reputation: 2257
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!
Upvotes: 3
Reputation: 54117
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.
Upvotes: 3
Reputation: 19570
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.
Upvotes: 4