I am working on on a winforms C# application and want to give the user an option to change the colour of the form background and text throughout the application.
The application contains panels, labels, textboxes etc.
One way I thought of was to store the user preference as the colours RGB value and have the form set it when the form loads for all the various controls. But this way seems a bit laboured.
Is there an easier or more effective way of achieving this?
.Controlscollection of every control, you can pass everything that exists on each form in to a function onLoadthat reads theControltype, and sets property values from the settings. for dynamically created controls, you can just have a factory likevar textBox = ControlFactory.Create<TextBox>();that does the same thing. That factory could even return Decorated versions if you want to do something totally custom. - Bradley UffnerPropertyGridcontrol to edit theSettingsclass at run-time. - Reza Aghaei