Back to Devexpress

Localize Skin Selectors

windowsforms-3096-build-an-application-application-skins-how-to-localize-bar-and-ribbon-skin-items.md

latest2.4 KB
Original Source

Localize Skin Selectors

  • Jan 27, 2026
  • 2 minutes to read

You can utilize a Localizer object to customize skin menus, instead of iterating through each Bar skin sub-menu item and Ribbon skin gallery item container to manually modify the items. This approach allows you to customize skin items in all existing bar sub-menus and Ribbon galleries simultaneously.

  1. Create a BarLocalizer class descendant and override its virtual XtraLocalizer<T>.GetLocalizedString method.

  2. Use the static BarLocalizer.Active property to set a new instance of your custom class as the current bar localizer. Call this method in the Program class before the Application.Run method call, as shown below.

  3. Run the application to see the result.

Important

If the custom localizer is assigned after a bar skin sub item, or if the Ribbon skin gallery is already initialized (for example, on the Load event), skin items will display default captions. In this case, call static SkinHelper.InitSkinPopupMenu and SkinHelpber.InitSkinGallery methods to initialize skin items again and activate the localizer.

csharp
void ucBar_Load(object sender, EventArgs e) {
    BarLocalizer.Active = new MyBarLocalizer();
    //refresh bar sub-item links
    skinBarSubItem1.ClearLinks();
    SkinHelper.InitSkinPopupMenu(skinBarSubItem1);
    //refresh Ribbon gallery links
    SkinHelper.InitSkinGallery(skinRibbonGalleryBarItem1);
}
vb
Private Sub ucBar_Load(ByVal sender As Object, ByVal e As EventArgs)
    BarLocalizer.Active = New MyBarLocalizer()
    'refresh bar sub-item links
    skinBarSubItem1.ClearLinks()
    SkinHelper.InitSkinPopupMenu(skinBarSubItem1)
    'refresh ribbon gallery links
    SkinHelper.InitSkinGallery(skinRibbonGalleryBarItem1)
End Sub

See Also

WinForms Skins and Color Palettes

Bonus and Custom Skin Registration