Setting Tab.Label Programatically doesn't update

Ribbon for WPF Forum

Posted 12 years ago by Bryan Livingston
Version: 1.0.0340
Platform: .NET 3.0
Environment: Windows Vista (32-bit)
Avatar
When you set a Tab.Label property programatically after the tab is displayed, the rendered label text doesn't get updated.

I've tried doing InvalidateVisual() on the tab and the ribbon but it didn't help. Any workaround for this would be great.

Bryan

Comments (6)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bryan,

It seems like the style is caching it. We'll look into this more to find a better solution, but in the meantime, reapplying the style seems to update it:
ribbon.SelectedTab.Label = "Test";
ribbon.SelectedTab.Style = null;
ribbon.SelectedTab.Style = ((IRibbonControl)ribbon.SelectedTab).GetStyle();


Actipro Software Support

Posted 12 years ago by Bryan Livingston
Avatar
Thank you. That worked. It seems to mess up the size and label of the contextual tab group, but it's good enough for now I guess.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Good news... it took some doing but we now have a system where you can update images and labels programmatically on tabs and other controls in the ribbon and it will automatically recalculate group variants and tab layout sizes as needed. This will be in the next maintenance release.


Actipro Software Support

Posted 12 years ago by Bryan Livingston
Avatar
Sweet!. Thank you.
Posted 12 years ago by Bryan Livingston
Avatar
The style is being update now by itself and I no longer have to call the get style.

There still seems to be a problem with the Contextual Group heading getting resized. The color coded part will remain short if the tab heading get's expanded with a longer label.

Bryan
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks this is now fixed for the next maintenance release.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.