Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Collapse]Build an Application
  [Expand]Choose Application UI
   Data Management Controls
  [Expand]Printing and Exporting
  [Expand]WinForms MVVM
  [Collapse]Skins
    Add and Customize the Toolbar and Menu Skin Selector
    Add and Customize the Ribbon Gallery Skin Selector
    Build a Custom End-User Skin Selector
    How To: Localize Bar and Ribbon Skin Items
    Bonus and Custom Skin Registration
    Design-Time Skinning
  [Expand]Localization
  [Expand]Right-to-Left Layout
   Redistribution and Deployment
 [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]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Add and Customize the Toolbar and Menu Skin Selector

This article explains how to allow end-users to select skins at runtime using the embedded Toolbar and Menu Skin Selector.

Expanded Add Skin Selector

Bars provide a SkinBarSubItem object to switch application skins at runtime. This item is a sub-menu that provides access to most relevant skins right away, while the remaining skins are accessible through the nested "Bonus Skins" and "Theme Skins" sub-menus.

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

Once you add a required skin item, there is no need to manually implement its functionality. Clicking menu items will automatically apply related skins.

Technically, a SkinBarSubItem object is just an automatically populated BarSubItem object. So to modify this menu, traverse its items by using the BarCustomContainerItem.ItemLinks collection and customize them as regular bar item links. The following documentation sections illustrate how to modify this skin menu.

Links that represent individual skins are objects of the BarButtonItemLink class. The "Bonus Skins" and "Theme Skins" sub-items are BarSubItemLink objects.

Expanded Hide Skins and Skin Groups

You can manually hide skins items or sub-groups.

  1. Create a string array that will contain unwanted skin names. These names can be full (e.g., "Office 2016 Colorful") or partial (e.g., "2007").

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

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

Expanded Change Captions and Icons Manually

You can also manually change captions and glyphs of items within a skin sub-item by iterating through the BarCustomContainerItem.ItemLinks collection. The process is identical to hiding specific skins and skin groups.

The figure below shows the actual result.

Expanded Change Skin Captions Using a Localizer

Instead of renaming skin items manually, you can use Localizer objects. See the How To: Localize Bar and Ribbon Skin Items article to learn more.

How would you rate this topic?​​​​​​​