Applying Themes in EditorsPackage

16 Aug 20232 minutes to read

The ThemesEnabled property specifies whether XPThemes should be used or not when BorderStyle is set to Fixed3D.

this.textBoxExt1.ThemesEnabled = true;                          
Me.textBoxExt1.ThemesEnabled = True

Enabled the themes when the border style is set to Fixed3D in WF TextBoxExt

Themes

The TextBoxExt provides the following themes for professional representation.

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

The themes can be applied by following these steps.

  • Load theme assembly
  • Apply theme

Load theme assembly

To set theme to TextBoxExt, 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 TextBoxExt, required theme assembly should be loaded.

using Syncfusion.Windows.Forms;

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        SkinManager.LoadAssembly(typeof(Syncfusion.WinForms.Themes.Office2016Theme).Assembly);
        SkinManager.LoadAssembly(typeof(Syncfusion.WinForms.Themes.Office2019Theme).Assembly);
        SkinManager.LoadAssembly(typeof(Syncfusion.HighContrastTheme.WinForms.HighContrastTheme).Assembly);

        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }
}
Imports Syncfusion.Windows.Forms

Friend NotInheritable Class Program
	''' <summary>
	''' The main entry point for the application.
	''' </summary>
	Private Sub New()
	End Sub
	<STAThread>
	Shared Sub Main()
		SkinManager.LoadAssembly(GetType(Syncfusion.WinForms.Themes.Office2016Theme).Assembly)
		SkinManager.LoadAssembly(GetType(Syncfusion.WinForms.Themes.Office2019Theme).Assembly)
		SkinManager.LoadAssembly(GetType(Syncfusion.HighContrastTheme.WinForms.HighContrastTheme).Assembly)

		Application.EnableVisualStyles()
		Application.SetCompatibleTextRenderingDefault(False)
		Application.Run(New Form1())
	End Sub
End Class

Apply theme

You can change the appearance of TextBoxExt control by using ThemeName property.

this.textBoxExt1.ThemeName = "Office2019Colorful";
Me.textBoxExt1.ThemeName = "Office2019Colorful"

Set the Office2019theme to WF TextBoxExt