change postion of ribbongroup

I am now using the Ribbon control

I want to change position of Ribbongroup  

I want to change the groupindex so that RibbonGroupSettings stay on the last position depending on the visibility
of RibbongroupRoadMap

This doesnt work:

In FormCreate or FormShow:

if not RibbonGroupRoadMap.Visible
  RibbonGroupSettings.Groupindex := 3;
  RibbonGroupRoadMap.GroupIndex:= 4;

Open in new window

Groupindex is not changed and ribbonGroupSettings is on the same place (after roadmap)  ?
Can anybody give an explanation and a solution ?
Who is Participating?
Ferruccio AccalaiConnect With a Mentor Senior developer, analyst and customer assistance Commented:
This happens because you probably are trying to assign to RibbonGroupSettings an already assigned GroupIndex (probably the RibbonGroupMap one).
Instead of change all the two TRibbonGroup GroupIndex, change just the once you want to move to the last.
You can assign every index you prefere just taking care that it's the higher one.

So you can simply do this

if not RibbonGroupRoadMap.Visible
  RibbonGroupRoadMap.GroupIndex:= 100; //this should be for sure the higher in your app

Than if you want to reorder it again in its original position just reassign its original index (I guess 3), so don't change any other GroupIndex. This way you can manage the grouping at runtime as you prefere.

advance1Author Commented:
Thks,sound good
I will try it monday
advance1Author Commented:
Problem solved, Thks
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.