Description: Introduction
When applying a dark skin theme to my Windows Forms application which used a GroupBox
But as soon as I wanted to set the GroupBox.Enabled property to false, things did not look that good anymore.
As can be seen in the screendump, the standard GroupBox on the right automatically chooses a black color for the disabled state:
Background
SkinSettings Class
The skin themes are in a separate class SkinSettings, to keep the example small, it only has a few settings.
It also has a ColorDisabled() method for calculating the custom disabled Color.
Hide Shrink Copy Code
using System
using System.Drawing
namespace CustomControls1
{
/// <summary>
/// A simple SkinSettings class.
/// This could be extended to support more control colors.
/// </summary>
public static class SkinSettings
{
public static Color FormBackColor { get set }
public static Color FormForeColor { get set }
public s
To Search:
File list (Check if you may need any files):
CustomGroupBox\App.config
..............\CustomControls1.csproj
..............\CustomControls1.sln
..............\CustomControls1.v12.suo
..............\CustomGroupBox.cs
..............\Form1.cs
..............\Form1.Designer.cs
..............\Form1.resx
..............\PanelTransparent.cs
..............\Program.cs
..............\Properties
..............\..........\AssemblyInfo.cs
..............\..........\Resources.Designer.cs
..............\..........\Resources.resx
..............\..........\Settings.Designer.cs
..............\..........\Settings.settings
..............\SkinSettings.cs