[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Collapse]Build an Application
  [Expand]Choose Application UI
  [Expand]Printing and Exporting
  [Expand]WinForms MVVM
    Add and Customize the Toolbar and Menu Skin Selector
    Add and Customize the Ribbon Skin List and Skin Gallery
    Build a Custom End-User Skin Selector
    How To: Localize Bar and Ribbon Skin Items
    Bonus and Custom Skin Registration
    Design-Time Skinning
  [Expand]Right-to-Left Layout
   Redistribution and Deployment
   How to: Perform Actions On Application Startup
 [Expand]Controls and Libraries
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com

Add and Customize the Toolbar and Menu Skin Selector

You can add a Skin Selector to the Toolbar in an application, so that end-users can choose skins at runtime.

Expanded Add a Skin Selector

Bars provide a SkinBarSubItem object to switch application skins at runtime. This item is a sub-menu that displays a list of popular skins, as well as "Bonus Skins" and "Theme Skins" to access additional sub-menus.

At design time, click "[Add]" and select "Skin Menu (SkinBarSubItem)" from the drop-down menu to add a sub-menu to the toolbar.

Once you add a required skin item, there is no need to manually implement its functionality. Click a menu item to automatically apply the corresponding skin.

A SkinBarSubItem object is an automatically populated BarSubItem object. To modify this menu, traverse the items via the BarCustomContainerItem.ItemLinks collection and customize them as regular Bar Item Links. The following documentation sections illustrate how to modify this skin menu.

Note that links that represent individual skins are BarButtonItemLink class objects. Sub-items ("Bonus Skins" and "Theme Skins") are BarSubItemLink objects.

Expanded Hide Skins and Skin Groups

You can manually hide a skin item or a sub-group.

  1. Create a string array of skin names to exclude. You can use the full name (e.g., "Office 2016 Colorful") or partial name (e.g., "2007").

  2. Create a custom method that will iterate through the bar skin sub-item and remove skins that match values in the array. Similarly, you can hide sub-menus with bonus skins.

  3. Call your method from the Load event handler to ensure that the skin sub-item is initialized.

Expanded Change Captions and Icons Manually

Iterate through the BarCustomContainerItem.ItemLinks collection to manually change an item caption or glyph within a skin sub-item. This is similar to the process used to hide specific skins and skin groups.

The figure below shows the result.

Expanded Change Skin Captions Using a Localizer

You can also use a Localizer object to rename skin items. See the How To: Localize Bar and Ribbon Skin Items article to learn more.

Is this topic helpful?​​​​​​​