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.
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.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With