Themes in Windows Forms Form (SfForm)

17 Sep 20214 minutes to read

Windows Forms Form (SfForm) offers the following six built-in themes for professional representation:

  • Office2016Colorful
  • Office2016White
  • Office2016DarkGray
  • Office2016Black
  • Office2019Colorful
  • HighContrastBlack

Themes can be applied to SfForm by following these steps:

  • Load theme assembly
  • Apply theme

Load theme assembly

To set theme to SfForm, the following assemblies should be added as reference in any application.

Assemblies

        Themes

Syncfusion.Office2016Theme.WinForms        Office2016Colorful
Office2016White
Office2016DarkGray
Office2016Black
Syncfusion.Office2019Theme.WinForms Office2019Colorful
Syncfusion.HighContrastTheme.WinForms HighContrastBlack

Before applying theme to SfForm, required theme assembly should be loaded.

using Syncfusion.WinForms.Controls;

static class Program
{
    /// <summary>
    /// The main entry point for an application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey());
        SfSkinManager.LoadAssembly(typeof(Syncfusion.WinForms.Themes.Office2016Theme).Assembly);
        SfSkinManager.LoadAssembly(typeof(Syncfusion.WinForms.Themes.Office2019Theme).Assembly);
        SfSkinManager.LoadAssembly(typeof(Syncfusion.HighContrastTheme.WinForms.HighContrastTheme).Assembly);
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }
}
Imports Syncfusion.WinForms.Controls

Friend NotInheritable Class Program
	''' <summary>
	''' The main entry point for the application.
	''' </summary>
	Private Sub New()
	End Sub
	<STAThread>
	Shared Sub Main()
		Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey())
		SfSkinManager.LoadAssembly(GetType(Syncfusion.WinForms.Themes.Office2016Theme).Assembly)
		SfSkinManager.LoadAssembly(GetType(Syncfusion.WinForms.Themes.Office2019Theme).Assembly)
		SfSkinManager.LoadAssembly(GetType(Syncfusion.HighContrastTheme.WinForms.HighContrastTheme).Assembly)
		Application.EnableVisualStyles()
		Application.SetCompatibleTextRenderingDefault(False)
		Application.Run(New Form1())
	End Sub
End Class

Apply theme

The appearance of SfForm can be changed using ThemeName of SfForm.

Office2016Colorful

This option helps to set the Office2016Colorful theme.

sfForm.ThemeName = "Office2016Colorful";
sfForm.ThemeName = "Office2016Colorful"

Office2016Colorful theme applied in winforms sfform

Office2016White

This option helps to set the Office2016White theme.

sfForm.ThemeName = "Office2016White";
sfForm.ThemeName = "Office2016White"

Office2016White theme applied in winforms sfform

Office2016DarkGray

This option helps to set the Office2016DarkGray theme.

sfForm.ThemeName = "Office2016DarkGray";
sfForm.ThemeName = "Office2016DarkGray"

Office2016DarkGray theme applied in winforms sfform

Office2016Black

This option helps to set the Office2016Black theme.

sfForm.ThemeName = "Office2016Black";
sfForm.ThemeName = "Office2016Black"

Office2016Black theme applied in winforms sfform

Office2019Colorful

This option helps to set the Office2019Colorful theme.

sfForm.ThemeName = "Office2019Colorful";
sfForm.ThemeName = "Office2019Colorful"

Office2019Colorful theme applied in winforms sfform

HighContrastBlack

This option helps to set the HighContrastBlack theme.

sfForm.ThemeName = "HighContrastBlack";
sfForm.ThemeName = "HighContrastBlack"

Highcontrastblack theme applied in winforms sfform