Loading...
Loading...
Comprehensive guide for implementing Syncfusion Windows Forms SkinManager and theme application. Use this when working with WinForms themes, SkinManager, or applying Office2016/Office2019 themes to controls. This skill covers theme assemblies, VisualTheme configuration, ApplicationVisualTheme setup, and custom control styling.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-themingSyncfusion.Shared.Baseusing Syncfusion.Windows.Forms;
namespace MyWinFormsApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Create SkinManager instance
SkinManager skinManager1 = new SkinManager(this.components);
// Apply theme to entire form (all Syncfusion controls)
skinManager1.Controls = this;
skinManager1.VisualTheme = VisualTheme.Office2016Black;
}
}
}using Syncfusion.Windows.Forms;
using Syncfusion.WinForms.Themes;
static class Program
{
[STAThread]
static void Main()
{
// Load theme assembly (for Office2019, Office2016, HighContrast)
SkinManager.LoadAssembly(typeof(Office2019Theme).Assembly);
// Set application-wide theme
SkinManager.ApplicationVisualTheme = "Office2019Colorful";
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}// Apply theme to all Syncfusion controls in a form
SkinManager skinManager1 = new SkinManager(this.components);
skinManager1.Controls = this; // 'this' refers to the form
skinManager1.VisualTheme = VisualTheme.Office2016White;// Option 1: Using SkinManager
skinManager1.Controls = treeViewAdv1;
skinManager1.VisualTheme = VisualTheme.Office2016Colorful;
// Option 2: Using ThemeName property
this.treeViewAdv1.ThemeName = "Office2019Colorful";// Office2019 themes
SkinManager.LoadAssembly(typeof(Office2019Theme).Assembly);
// Office2016 themes (for SfDataGrid, SfButton, etc.)
SkinManager.LoadAssembly(typeof(Syncfusion.WinForms.Themes.Office2016Theme).Assembly);
// HighContrast themes
SkinManager.LoadAssembly(typeof(HighContrastTheme).Assembly);// For Theme Studio themes, customize using ThemeStyle
this.treeViewAdv1.ThemeName = "Office2019Colorful";
this.treeViewAdv1.ThemeStyle.BackColor = System.Drawing.Color.White;
this.treeViewAdv1.ThemeStyle.BorderColor = System.Drawing.Color.SteelBlue;
this.treeViewAdv1.ThemeStyle.TreeNodeAdvStyle.TextColor = System.Drawing.Color.Red;| Property | Description | Type |
|---|---|---|
| Specifies the parent control/form for which theme is applied | Control |
| Specifies the theme style to apply | Enum (VisualTheme) |
| Sets theme for entire application (static property) | String |
| Method | Description | Parameters |
|---|---|---|
| Applies theme to specified control | Control, VisualTheme enum |
| Applies theme to specified control | Control, theme name string |
| Loads theme assembly before applying theme | Assembly object |
| Property | Description | Available On |
|---|---|---|
| Theme name to apply to individual control | All Syncfusion controls |
| Customize theme appearance properties | Non-Sf controls |
| Customize theme appearance properties | Sf-prefixed controls |
| Allow theme to override user customizations | Theme Studio compatible controls |
Syncfusion.Office2016Theme.WinForms.dllSyncfusion.Office2019Theme.WinForms.dllSyncfusion.HighContrastTheme.WinForms.dllLoadAssembly()ApplicationVisualThemeCanOverrideStyleLoadAssembly()ControlsLoadAssembly()CanOverrideStylefalseThemeStyleStyle