Loading...
Loading...
Compare original and translation side by side
Syncfusion.Shared.BaseSyncfusion.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;
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());
}
}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;// 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";// 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);// 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;// 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 |
| 属性 | 说明 | 类型 |
|---|---|---|
| 指定要应用主题的父控件/窗体 | Control |
| 指定要应用的主题样式 | 枚举(VisualTheme) |
| 为整个应用设置主题(静态属性) | 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 |
| 方法 | 说明 | 参数 |
|---|---|---|
| 为指定控件应用主题 | Control, VisualTheme 枚举 |
| 为指定控件应用主题 | Control, 主题名称字符串 |
| 在应用主题前加载主题程序集 | Assembly 对象 |
| 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 控件 |
| 自定义主题外观属性 | 非 Sf 前缀控件 |
| 自定义主题外观属性 | Sf 前缀控件 |
| 允许主题覆盖用户自定义样式 | 兼容 Theme Studio 的控件 |
Syncfusion.Office2016Theme.WinForms.dllSyncfusion.Office2019Theme.WinForms.dllSyncfusion.HighContrastTheme.WinForms.dllSyncfusion.Office2016Theme.WinForms.dllSyncfusion.Office2019Theme.WinForms.dllSyncfusion.HighContrastTheme.WinForms.dllLoadAssembly()ApplicationVisualThemeCanOverrideStyleLoadAssembly()ApplicationVisualThemeCanOverrideStyleLoadAssembly()ControlsLoadAssembly()CanOverrideStylefalseThemeStyleStyleLoadAssembly()ControlsLoadAssembly()CanOverrideStylefalseThemeStyleStyle