Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Move Tabs / Groups Collapse All
Subject Author Date
Gunter Avenius Oct 24, 2007 - 5:58 AM

Hello,

how can i move Tabs or groups in a Ribbon via Code? (vb2005)

Example: i have a Ribbon with:
<tab1>
<group1_1>
<group1_2>
<group1_3>
<tab2>
<group2_1>
<tab3>

how can i move the group3 to:
<tab1>
<group1_1>
<group1_3>
<group1_2>
<tab2>
<group2_1>
<tab3>

or how can i move the tab3 to:
<tab3>
<tab1>
<group1_1>
<group1_2>
<group1_3>
<tab2>
<group2_1>

Best regards
Gunter


Gunter Avenius Oct 25, 2007 - 9:41 AM

Hello,

Tahnks for the reply.

I have:
<tab1>
<tab2>
<tab3>
<tab4>

I select the Tab3 an run the following code:

Dim curTab As Elegant.Ui.RibbonTabPage
curTab = Ribbon1.CurrentTabPage

Ribbon1.TabPages.Remove(curTab)
Ribbon1.TabPages.Insert(0, curTab)

Result:
<tab1>
<tab2>
<tab4>
<tab3>

Tab1 is selected.

what wrong?

Thanks for help.

Best regards
Gunter


Technical Support Oct 25, 2007 - 12:27 PM

There is a bug in the current version of Elegant Ribbon, when the Insert method always adds a tab page to the end of the collection. This bug is already fixed and the next release is coming soon.

Technical Support Oct 25, 2007 - 6:41 AM

1. In the first case, you should work with the tab page’s Controls collection. You need to swap group1_2 and group1_3. Here is how to do this

tab1.Controls.SetChildIndex(group1_3, tab1.Controls.GetChildIndex(group1_2));
2. In the second case, use the Ribbon.TabPages collection. The below code allows you to move tab3 to the zero position
ribbon1.TabPages.Remove(tab3);
ribbon1.TabPages.Insert(0, tab3);


Gunter Avenius Oct 24, 2007 - 10:11 AM

Hello,

the same: how can i move controls (Buttons, Checkboxes, or other Ribbon Controls) in a Group?

Thanks

Gunter

Technical Support Oct 25, 2007 - 6:43 AM

You can move controls within a group by using the Controls collection in the same way as we described it above for groups within a tab page.