Back to Devexpress

SkinManager.Skins Property

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

latest4.5 KB
Original Source

SkinManager.Skins Property

Gets the collection of skins that are currently available for use in DevExpress controls.

Namespace : DevExpress.Skins

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

csharp
public SkinContainerCollection Skins { get; }
vb
Public ReadOnly Property Skins As SkinContainerCollection

Property Value

TypeDescription
DevExpress.Skins.SkinContainerCollection

A DevExpress.Skins.SkinContainerCollection collection that stores available skins.

|

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Skins property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-keep-a-look-and-feel-of-windows-forms-in-sync-e2243/CS/ThreadedSkinning/Form1.cs#L19

csharp
comboBoxEdit1.EditValue = DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName;
foreach(DevExpress.Skins.SkinContainer cnt in DevExpress.Skins.SkinManager.Default.Skins) {
    comboBoxEdit1.Properties.Items.Add(cnt.SkinName);

how-to-keep-a-look-and-feel-of-windows-forms-in-sync-e2243/VB/ThreadedSkinning/Form1.vb#L16

vb
comboBoxEdit1.EditValue = UserLookAndFeel.Default.SkinName
For Each cnt As DevExpress.Skins.SkinContainer In DevExpress.Skins.SkinManager.Default.Skins
    comboBoxEdit1.Properties.Items.Add(cnt.SkinName)

See Also

SkinManager Class

SkinManager Members

DevExpress.Skins Namespace