You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: styling-and-appearance/default-theme.md
+38-38
Original file line number
Diff line number
Diff line change
@@ -10,110 +10,110 @@ position: 1
10
10
11
11
# Default Theme
12
12
13
-
All RadControls from the Telerik UI for WinForms suite get the **ControlDefault** theme applied to them by default if no other theme is set.
14
-
15
-
>caption ControlDefault theme
13
+
Telerik UI for WinForms comes with a set of built-in themes that enhance the visual appearance of the components, helping you achieve an outstanding look of your application. Each theme determines the colors, borders, backgrounds, size, layout, position, font, font size, etc of the components.
16
14
17
-

15
+
All RadControls from the Telerik UI for WinForms suite get the **ControlDefault** theme applied to them by default if no other theme is set. If you create a new Windows Forms App, then drag any RadControl from the Toolbox and drop it onto the form, the **ControlDefault** theme should be automatically applied.
18
16
19
-
If you drag a control from the toolbox and drop it onto the form, the **ControlDefault** theme is applied as well.
20
-
21
-
>caption Design time - default theme
17
+
>caption Design time - ControlDefault theme
22
18
23
19

24
20
25
-
Using the [built-in themes]({%slug winforms/themes/using-default-themes%}) that come out of the box with the installation of the Telerik UI for WinForms suite, you can apply a different theme for the specific control.
26
-
27
21
## Fluent theme as Default
28
22
29
-
As of **R1 2021**, it is possible to define which theme is your **default theme** (e.g. **ControlDefault**) for the controls even at design time. This can be defined in the App.config file as follows:
23
+
As of **R1 2021**, Telerik UI for WinForms starts using **Fluent**theme as default as it provides more modern and fresh look. If you create a new Telerik Windows Forms Application, then drag any RadControl from the Toolbox and drop it onto RadForm, the **Fluent** theme should be automatically applied .
30
24
25
+
**Fluent** theme is defined in the **App.config** file as follows:
>important The **Fluent**theme is now a part of the **Telerik.WinControls** assembly and it is statically available everywhere just like the **ControlDefault** theme. As a result, it is no longer necessary to instantiate the **FluentTheme** type.
46
+
>note **Fluent**and **ControlDefault** themes are both included in the **Telerik.WinControls** assembly. They are available at any time, and it is not necessary to reference them explicitly in the project references.
53
47
54
-
>note The **Telerik.WinControls.Themes.Fluent** assembly is still available and it remains for compatibility so that existing projects don't break when they upgrade.
55
48
56
-
>note The theme settings are being read upon opening the first form designer in the project. If you change the default theme in App.config, it is necessary to **close all opened designers and open them again**.
49
+
## Other Telerik theme as Default
57
50
58
-
We are using the above App.config in the VS templates, so that new Telerik projects created by the Visual Studio extension have the Fluent theme set as default.
51
+
All Telerik themes that Telerik UI for WinForms offers, can be used as default theme in the application either at design time and run time. You can check other themes styles [here](https://docs.telerik.com/devtools/winforms/styling-and-appearance/themes-style).
59
52
60
-
## Other Telerik theme as Default
53
+
To use any Telerik theme you should follow these two steps below :
54
+
1. Add the relevant theme assembly to the project references. For example, if you prefer using the Windows11Compact theme in your application, you should add a reference to the **Telerik.WinControls.Themes.Windows11** in your project. You can do this by either drag-drop the theme from the Toolbox or reference it from your installation folder.
61
55
62
-
All Telerik themes are supported with the above API, it is, however, necessary that the project references the correct assembly, e.g. add reference to Telerik.WinControls.Themes.Material and in the App.config set:
56
+
>note When you use the **UI.for.WinForms.AllControls** Telerik NuGet package, all the available themes are included in the package.
57
+
58
+
2. Specify the TelerikWinFormsThemeName in the **App.config** file:
If the user sets a valid Telerik theme name (other than Fluent and ControlDefault) as default, but the project misses the theme assembly reference, the following message appears:
80
-
81
-

74
+
Once, the two steps are completed, you can close and reopen the designer file again to ensure the theme is applied:
82
75
83
-
Once the necessary assembly is referred, the designer loads with the correct design:
76
+
>caption Design time - Windows11Compact theme
84
77
85
78

86
79
87
-
>note In order to use the Theme components, just drag and drop them from the VS Toolbox to the form. This will add a reference to the corresponding theme assembly in the project and will enable the theme in the **ThemeName** drop-down of all Telerik controls on the form.
80
+
### Missing Assembly Reference Message
81
+
82
+
If it happens that a valid Telerik theme name is used in the App.config, but the project misses the theme assembly reference, the following message will appear indicating missing assembly reference when you try to load the designer:
83
+
84
+

85
+
86
+
Theme settings are read upon opening the form designer in the project for the first time. If you change the default theme in App.config, it might be necessary to close all opened designers, then open them again to ensure the newest changes are kept in Visual Studio.
88
87
89
88
## Custom theme as Default
90
89
91
-
Since it is possible to build your own [custom style]({%slug winforms/themes/using-custom-themes%}), it is possible to specify this theme as default. We will use the same API to load client's themes defined in their own assemblies: [Creating a theme component]({%slug winforms/themes/advanced-topics/adding-custom-redistributable-themes-to-your-application-/creating-a-theme-component%})
90
+
It is also possible to set a client's custom theme as default theme in an application. As we provide an apportunity for our clients to build their own [custom style]({%slug winforms/themes/using-custom-themes%})theme, we can use the same API to load client's theme defined in their own assemblies: [Creating a theme component]({%slug winforms/themes/advanced-topics/adding-custom-redistributable-themes-to-your-application-/creating-a-theme-component%})
92
91
93
-
>note With the __2024 Q2__ version of our controls it is necessary to use the assembly fully qualified name when defining it inside the App.config.
92
+
>note To use a custom theme as default it is necessary to use the assembly fully qualified name inside the App.config. Also, it is important to create an instance of the newly created theme.
94
93
95
-
Imagine a client creates a theme with name **LightCoral**. Besides the theme name, the App.config will also need the theme type and theme assembly name.
94
+
Let's say there is a custom **Windows11CompactLightBlue** theme created, which is a variation of the basic Windows11Compact theme. Besides the theme name, the App.config will also need the theme type and theme assembly name, version, culture, and public key token:
95
+
96
+
>caption Design time - Custom Windows11CompactLightBlue theme
Thus, if you drag a new **RadButton** from the Toolbox, it will be with the LightCoral theme applied.
115
+
>important Full tutorial demonstrating the exact setup of the above example is available in the following KB article: [Custom theme as default](https://testdocs.telerik.com/devtools/winforms/knowledge-base/custom-theme-as-default).
116
+
Complete projects in .NET9 and NET Framework 48 are available in our SDK repo [here](https://github.com/telerik/winforms-sdk/tree/master/Themes/CustomThemeAsDefault).
0 commit comments