Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms Style / UI Look and Feel Tips

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.

like image 257
B Z Avatar asked Feb 16 '09 14:02

B Z


3 Answers

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.

like image 142
Morten Christiansen Avatar answered Nov 19 '22 23:11

Morten Christiansen


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.

like image 23
Richard Ev Avatar answered Nov 19 '22 23:11

Richard Ev


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!

like image 3
1kevgriff Avatar answered Nov 19 '22 22:11

1kevgriff