Back to Devexpress

SkinManager.Default Property

windowsforms-devexpress-dot-skins-dot-skinmanager-e17f2425.md

latest3.0 KB
Original Source

SkinManager.Default Property

Provides access to the default skin manager.

Namespace : DevExpress.Skins

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public static SkinManager Default { get; }
vb
Public Shared ReadOnly Property [Default] As SkinManager

Property Value

TypeDescription
SkinManager

A SkinManager object that represents the default skin manager.

|

Example

The following code shows how to populate a combo box editor with names of available skins. When a specific item is selected from the editor’s dropdown, the corresponding skin is applied to controls.

To get the available skin names, the SkinManager.Skins property is used.

In this example, the selected skin is applied via the DefaultLookAndFeel object. It specifies look and feel settings used by all Developer Express controls and forms by default.

csharp
using DevExpress.XtraEditors;
using DevExpress.Skins;

// Handle the SelectedIndexChanged event to respond to selecting the skin name.
comboBoxEdit1.SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged);
// Add available skin names to the combo box.
foreach(SkinContainer cnt in SkinManager.Default.Skins) {
    comboBoxEdit1.Properties.Items.Add(cnt.SkinName);
}

//...

void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e) {
    ComboBoxEdit comboBox = sender as ComboBoxEdit;
    string skinName = comboBox.Text;
    DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = skinName;
}
vb
Imports DevExpress.XtraEditors
Imports DevExpress.Skins

' Handle the SelectedIndexChanged event to respond to selecting the skin name.
AddHandler ComboBoxEdit1.SelectedIndexChanged, AddressOf comboBoxEdit1_SelectedIndexChanged
' Add available skin names to the combo box.
For Each cnt As SkinContainer In SkinManager.Default.Skins
    ComboBoxEdit1.Properties.Items.Add(cnt.SkinName)
Next cnt

'...

Sub comboBoxEdit1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
    Dim comboBox As ComboBoxEdit = sender
    Dim skinName As String = comboBox.Text
    DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = skinName
End Sub

See Also

SkinManager Class

SkinManager Members

DevExpress.Skins Namespace