Majorsilence.Forms.Theming.WinForms 26.8.0

dotnet add package Majorsilence.Forms.Theming.WinForms --version 26.8.0
                    
NuGet\Install-Package Majorsilence.Forms.Theming.WinForms -Version 26.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Majorsilence.Forms.Theming.WinForms" Version="26.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Majorsilence.Forms.Theming.WinForms" Version="26.8.0" />
                    
Directory.Packages.props
<PackageReference Include="Majorsilence.Forms.Theming.WinForms" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Majorsilence.Forms.Theming.WinForms --version 26.8.0
                    
#r "nuget: Majorsilence.Forms.Theming.WinForms, 26.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Majorsilence.Forms.Theming.WinForms@26.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Majorsilence.Forms.Theming.WinForms&version=26.8.0
                    
Install as a Cake Addin
#tool nuget:?package=Majorsilence.Forms.Theming.WinForms&version=26.8.0
                    
Install as a Cake Tool

Majorsilence.Forms.Theming.WinForms

Applies a Majorsilence.Forms CSS theme to real System.Windows.Forms controls, so a mixed migration app — Majorsilence.Forms controls embedded in a WinForms shell, or the reverse — is themed from one stylesheet: same tokens, same selectors, same diagnostics.

using Majorsilence.Forms.Theming.WinForms;

// Once, as early as possible (before the first form for the process-wide switches):
WinFormsCssTheme.Apply (File.ReadAllText ("Themes/graphite.css"));   // throws ThemeCssException on errors

// Or keep re-applying while you edit the file (the Theme Studio workflow):
using var watch = WinFormsCssTheme.Watch ("Themes/graphite.css");

// Forms constructed after the apply: style them and keep styling controls added later.
var form = new MainForm ();
WinFormsCssTheme.Track (form);
form.Show ();

// What could not be expressed on WinForms (never silently ignored):
foreach (var d in WinFormsCssTheme.Diagnostics)
    Console.WriteLine (d);

WinForms has no styling system to hook, so the applier walks the control tree and sets properties: BackColor / ForeColor / Font everywhere, FlatAppearance on buttons, DataGridView cell styles, a token-built ToolStripProfessionalRenderer for every menu, tool bar, status bar and context menu, selection colours on ListBox / TreeView / ListView (selection-only owner draw, never on a control the app already owner-draws), the ProgressBar fill, Application.SetDefaultFont / SetColorMode, and the Windows 11 title bar via DWM. A control whose BackColor / ForeColor / Font the app set explicitly keeps it.

The property × control support matrix (native / approximate / unsupported) is WinFormsThemeSupport and is published as docs/theming-winforms.md.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.8.0 50 10/3/2026
26.7.0 45 10/3/2026
26.6.0 43 10/2/2026
26.5.0 41 10/1/2026
26.4.0 80 9/29/2026
26.3.0 94 9/25/2026
26.2.0 92 9/23/2026
26.1.0 89 9/21/2026
26.0.52 98 9/12/2026