How to create a common look and behavious in windows forms.

T

Tony Johansson

Hello!

When designing a Website you can use styles,master pages and themes but how
do you do when you want a common look and behaviour in windows forms.

For example you want all Buttons to have another colour and you might have
100 forms and each form might have several buttons.

//Tony
 
J

Jeff Johnson

When designing a Website you can use styles,master pages and themes but
how do you do when you want a common look and behaviour in windows forms.

For example you want all Buttons to have another colour and you might have
100 forms and each form might have several buttons.

You need to search for the term "skinning." Be aware that doing such a thing
is generally frowned upon in desktop apps. The idea is that your app should
conform to the look and feel of Windows, not "stand apart from the crowd."
Only very specialized apps are generally exempted from this, like audio and
video players.
 
A

Andy O'Neill

Hello!

When designing a Website you can use styles,master pages and themes but how
do you do when you want a common look and behaviour in windows forms.

For example you want all Buttons to have another colour and you might have
100 forms and each form might have several buttons.

//Tony

If you don't like battleship grey then you really ought to be
developing in WPF rather than windows forms.
But...
You have control inheritance in winforms so if you really wanted all
buttons to be blue you could create a blue button user control.
I wouldn't recommend that approach though.
When I was doing some compact framework winforms development I used
this approach a lot. Very specific requirements and CF for win ce6 is
rather limiting. The result is a pain to maintain.
 
R

Rick Lones

Tony said:
Hello!

When designing a Website you can use styles,master pages and themes but how
do you do when you want a common look and behaviour in windows forms.

For example you want all Buttons to have another colour and you might have
100 forms and each form might have several buttons.

//Tony

At first it seemed like you were asking something really basic about deriving
customized controls for use in a new application. But now I wonder if what you
are meaning to ask is whether there is a slick way to change certain properties,
e.g., button color, of all the controls in an large solution which already exists.

Is this what you are getting at?
 
A

Arne Vajhøj

When designing a Website you can use styles,master pages and themes but how
do you do when you want a common look and behaviour in windows forms.

For example you want all Buttons to have another colour and you might have
100 forms and each form might have several buttons.

Win forms and web forms are fundamentally different, so not
really a surprise that they are also different in this aspect.

I think the most common solution is write a style guide an
enforce its usage in code reviews.

If you insist on a software solution, then you should drop
the new keyword for creating objects and use the abstract factory
GoF pattern, which was designed for this problem.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top