How can I easily keep consistent UI settings in C# Winform application?

Posted by Lukas on Stack Overflow See other posts from Stack Overflow or by Lukas
Published on 2010-03-14T20:39:39Z Indexed on 2010/03/14 20:45 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

I have a lot of different UserControls and would like to maintain consistent UI settings (mainly colors and fonts). My first try was this:

public class UISettings
{
//...
    public void SetupUserControl(ref UserControl ctrl)
    {
        ctrl.BackColor = this.BackColor;
    }
}

to be called in every control like this:

settings.SetupUserControl(ref this);

As this is read-only it cannot be passed by ref argument so this does not work. What are other options to keep consistent UI without manually changing properties for every item?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms