1

I am building a windows forms application where a very consistent look and feel across all modules is of very high priority. Apart from standard .NET controls it uses a lot of third party controls from different vendors. I would like to have the ability to change the entire look and feel of the application in one go, may be with upgraded versions of the software. Very much like skinning, but generally I have seen that skinning abilities by third party providers work well with their set of controls only while I have controls from multiple vendors.

I am planning to build a complete set of user controls inherited from either .NET controls or third party controls where relevant, and use our set of controls only. That way I might have to create a lot of controls (e.g. Text, DropDown, List, Grid, DTPicker, etc. etc.) but I guess I will have a reasonable command over the look and feel, i.e. I can propagate any changes in the base (e.g. use Tahoma font in all places instead of MS Sans Serif) by just rebuilding the complete app.

I was also thinking that the ability to change the font across the app alone, among others, is something that would cost almost all types of controls to be inherited.

Questions:

  1. Do you feel that this is the right way (control inheritance) to proceed towards consistent look and feel across an app?

  2. Do you support the ability to change the entire application font in one shot as a good requirement?

Suggestions, comments are greatly appreciated.

3 Answers 3

3

1). IMHO you will have bulky hierarchy. It's better, in my opinion, to have adapters for group of controls.

Infragistics, for instance, have complicates and, in many ways, illogical inheritance hierarchy. If I had to implement skinning quickly, I'd implemented skinning logic in a common form (or other container) class instead of creating large set of own controls.

2
  • Skinning/styling should really only require inheritance if the controls themselves do not provide the properties necessary to sufficiently customize their look and feel. If the properties are there, then what's really required is a way to dynamically enumerate controls and configure their properties to match the style. This is still a difficult problem (with some ugly switching logic in the style manager), but it's much easier than overriding every UI control.
    – Dan Bryant
    Sep 9, 2010 at 13:34
  • Interesting direction !! As I commented @STO also, I will explore this area for performance and usability where I will pass all my form controls through a "Skinner" which will skin controls that it has information about. Am a bit wary about performance though.
    – Rajarshi
    Sep 10, 2010 at 7:58
2

Is there any chance to use WPF? I suspect the complexity of control development in Windows Forms goes up exponentially with every level of inheritance.

WPF provides built-in/designed-for skinning which is far easier to implement and maintain. I strongly recommend exploring that avenue and use WPF if you can.

1
  • Sorry, we are running short in time and WPF is still not time tested for critical types of application (e.g. high volume handling POS systems). My architecture though has enough layering to replace the UI layer with WPF in future pretty easily. Will do that when time is right :)
    – Rajarshi
    Sep 10, 2010 at 7:30
0

as for Winforms, I know that a few Control Sets allow for suchlike things. Janus has a nice Set of Controls that can all register with a so-called VisualStyleManager. Changing the StyleManager's theme will automatically skin all Controls.

I don't implementing this yourself will make you happy...just go ahead and spend a few bucks on Janus or other components.

2
  • You did not read my post carefully enough. I am using Infragistics, ComponentOne and a few other components as well - all licensed !! However, as I mentioned, any skinning ability works with the vendor's specific set of controls. E.g. Infragistics' AppStylist will not work with ComponentOne. I need some standardization that can work in all cases. :)
    – Rajarshi
    Sep 10, 2010 at 7:54
  • Sorry, I misunderstood your intentions then. From what you described, I'm not sure if this is possible at all. Basically, you should stick to the Skinners you have (e.g. the AppStylist) and create an Adapter for them Sep 22, 2010 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.