I know I should generally avoid messing up with such system settings, but my application do already use nonstandard colors and I have no influence on that. I would like to be able to add standard .NET controls in some places, but their colors do not match. I would like to have a hack that would replace system colors for this one application. One more important thing to note is that it is a .NET application.
My (incomplete) ideas so far were:
Do you have any idea, what is the best (and complete) way to achieve this?
Select Personalization > Colors. In the list for Choose your mode, select Custom. In the list for Choose your default Windows mode, select Dark. In the list for Choose your default app mode, select Light or Dark.
To change the background color, select the form in Visual Studio and locate the BackColor property in the Properties panel. There are a number of ways to specify a color. Color by name - Simply type in a color name into the BackColor value field (for example Red, Yellow, Cyan etc).
Set the background in the Windows Forms DesignerOpen the project in Visual Studio and select the Panel control. In the Properties window, click the arrow button next to the BackColor property to display a window with three tabs. Select the Custom tab to display a palette of colors.
The windows accent color refers to the coloring of secondary or tertiary UI elements in your operating system. Windows applies the accent color to borders, buttons, notification icons, and (optionally) your Start menu, taskbar, or window title bars.
I would like to be able to add standard .NET controls in some places, but their colors do not match. I would like to have a hack that would replace system colors for this one application.
That's like driving a nail with a sledgehammer.
Rather than mucking up colors within the system itself, what you can do is inherit a new control from each of the stock controls you want to use. So instead of a plain TextBox you inherit from the stock TextBox control to create your own ThemedTextBox
. You setup this new control to use your app's color scheme by default, and because it is still a TextBox as far as the inheritance structure is concerned you can use it anywhere you'd use a normal textbox, including in the winforms designer.
In my early days I developed a program that registered a global message hook to owner draw window borders - I could theme all windows. This should be possible for a single application, too. However, this is not a simple task.
Otherwise I don't think that this will be possible. How about using themable third party controls such as Krypton Toolkit?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With