Hi all,
I have a contextual tab group called "Data Table" with a single sub-tab called "Setup".
The text of the tab-group gets truncated when the size of the sub-tab is small.
Please see scrennshot.
Can I somehow show the complete contextual-tab-group text even if the sub-tabs caption is small? I need to show the full group caption no matter what is in that group.
Regards
Michael
Hi Michael,
It's pretty unusual to have a single tab in it's own group, I think - although I'm pretty sure Office does do this on occasion.
There's no way to do that through the normal properties of the control. The tab is automatically sized by it's contents without regard to the ContextualTabGroup.
I have attached a sample project here that works around the issue. Basically, what the sample does is it sets the caption of the RibbonTab to the same caption as the ContextualTabGroup. This works out so that the tab is the same width as the ContextualTabGroup.
Of course, the problem with this is that the RibbonTab is now displaying the wrong text. So I used a CreationFilter to change the text on the UIElements - essentially changing it on the drawing level. So the RibbonTab in code still thinks it's caption is "Data Tables." But it only draws "Setup" on the screen.
HI Mike,
thanks for your help, but the problem with your solution is that I don't know what texts are schon in the captions in advance because I support multiple languages.
I would need to know if the text doesn't fit make itself wider not depending on sub-tabs.
Btw. It is not that unusual as you might think. Pls see screenshot from excel after adding a picture.
Hm. That's an approach I hadn't really considered. I don't think that's something we could do, since you, the developer, can set the font to whatever you want. It wouldn't necessary make sure for the control to automatically change the size of the font. Unless we added a property for that so you could opt-in to it.
Hi Mike,
big thanks for your help.
I guess the screenshot of office is already dealing with different sizes. As far as I can see it decreases the font size of the contextual tab group caption if the contained ribbon tab is smaller.
There are essentially two ways in which this problem could be addressed.
1) We could try to determine the width that the ribbon tab needs to be based on it's ContextualTabGroup and always show the ribbon tab at that width.
2) We could try to determine the width that the ribbon tab needs to be based on it's ContextualTabGroup and only show it at that width when it's part of a group and the group is actually displayed.
The workaround I gave you is essentially the first approach. But as you pointed out, this would only be viable if you knew the width of the text for both the ribbon tab and the contextual tab group up front.
I suppose the second approach is feasible. We could dynamically increase the size of the RibbonTab when the ContextualTabGroup is shown. But I spoke with the developers and they consider this a feature request. The current behavior is by design.
It's interesting that in the screen shot you have here, the text is the same size. In fact, it looks like Microsoft went out of their way to abbreviate the contextual tab group so that it would fit - probably because of the same kind of issue. I'd be really interested to know if Office ever has the same issue you are having here where the ContextualTab is much wider than the ribbon tab(s) it contains. If Office deals with this issue using either of the two methods I listed above, then I might be able to argue that this is a bug and we should match what Office does. Are you aware of any cases where the ribbon tab is smaller than it's contextual tab?
If not, the best thing you can do is Submit a Feature Request.