B Z
B Z

Reputation: 9453

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.

Upvotes: 8

Views: 4097

Answers (3)

Kevin Griffin
Kevin Griffin

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

Richard Ev
Richard Ev

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

Morten Christiansen
Morten Christiansen

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

Related Questions