refreshing delphi ribbongroup width

Hi, I'm new at using tribbon, I need to hide some buttons from a ribbongroup depending on which user is entering my software.   The buttons are hidden when I set the corresponding tAction.visible at false but the problem is that the ribbongroup does not resize to fit the remaining buttons, it just leaves a blank space even tough there is no more buttons visible on a large area on the right part of the ribbongroup.

Can I force delphi to recalculate the right width at runtime?
Buropro-CitationAsked:
Who is Participating?
 
jimyXCommented:
TRibbonGroups (RG) are free to set their width, until you add and set TActionClientItem.
i.e:
From ActionManager->ActionBars->Add new item and link to your TRibbonGroup, so far the RG can be resized at design-time or run-time. But the moment you select the recently created ActionBar and start adding Items and define their actions, even if it's a new empty action, the RG will be set to AutoSize, and now you can not resize.
So what you can do is do not link the items to the actions at design time, but rather link the Item to the action when you want to give the user (at run-time), and hence you get the RG ready to be resized.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.