How to change the system colors programatically

  • Thread starter Schuntermann Joerg \(IFAT IT MFG COC MES MAC\)
  • Start date
S

Schuntermann Joerg \(IFAT IT MFG COC MES MAC\)

This sounds like a trivial task: I'd like to change the default color
settings for certain system elements (e.g. Control, Meu, Window) inside a C#
program programatically during program initialization. All UI controls which
have one of their color property set to one of these settings (e.g.
button1.BackColor = System.Drawing.SystemColors.Control) shall be reendered
according to the customized control color.

These settings shall be valid for all threads in the application, all UI
appropriate UI elements, and all dynamically loaded assemblies.

Changing the registry will not do the job because the settings shall only be
valid in the application context. And changing each individual control seems
to be too cumbersome.

Any help is highly appreciated!
 
N

Nicholas Paldino [.NET/C# MVP]

Schuntermann,

You will have to change each element to do this. The reason is that
these settings are system-wide, and can not be changed on an
application-by-application basis (even through the API). You will have to
custom paint each UI element.

Hope this helps.
 

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