Is there a way to change the label of a tab in the RibbonControlCustomizationCategory

Ribbon for WPF Forum

Posted 10 years ago by Kris Goossens - Remmicom
Version: 13.2.0592
Avatar

Is there a way to change the label in the RibbonControlCustomizationCategory when using the method RibbonControlCustomizationCategory.GetCategories(Me.Ribbon)?

Because in Dutch the naming is ‘tabblad’ + the label of the ribbontab instead of the label of the tab + ‘tab’.

Also I don’t always want the exact label of the tab, because my WPF-app looks like outlook I have multiple ‘Start’ tabs. So I want to rename the first category In the ‘customize qat-menu window’ to ‘Start tab (email)’ and the second to ‘Start tab (agenda)’.

Kind regards

Kris

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kris,

When you look at the results of that method, you can iterate through the collection and update the Label property of each item as appropriate.  It looks like we don't currently expose the related source object on each RibbonControlCustomizationCategory instance though, so in your case where you say you don't know the exact label of the Tab, that could be a problem.  How ideally (in terms of API implementation) would you like to be able to customize these?


Actipro Software Support

Posted 10 years ago by Kris Goossens - Remmicom
Avatar

I think the most simple implementation would be an extra attached property in the ribbon:CloneService class. For example CloneService. CloneLabelInQuickAccessToolBar.

This should work for ribbon-tab, ribbon-group and ribbon-button.

Also I would set the word 'tab' (that is always attached to the label of the tab) in de stringresourcelibrary so this can be localized. If this is in stringformat type, you can choose where the label is set.

For example in English '{0} tab' , you would get 'Edit tab', but in Dutch it would be 'tabblad {0}' you would get 'tabblad Editeren'.

Grtz,

Kris

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kris,

We already have the text "tab" localized in SRName.UICustomizeQatTabText but that seems like it might still be a problem for you since you are trying to flip the order of the "tab" text and its actual label.

Our current Label building line is:

this.Label = contextualTabLabel + sourceTab.Label + " " + SR.GetString(SRName.UICustomizeQatTabText);

Where contextualTabLabel is filled in if the tab is a contextual tab.  Its value would be the contextual tab group label + " | ".

How should a contextual tab label look in Dutch?  Is it similar where you have:  ContextualTabGroupLabel | tabblad TabLabel

While we will update the string resources more based on what we discuss above, the other thing is that we already store the "source location" UIElement on RibbonControlCustomizationCategory and could expose that as a read-only property.  Then you could just update the auto-generated Label right after the categories are created.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.