We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the order of the ToolStripTabItems in WinForms RibbonControlAdv?

Platform: WinForms |
Control: RibbonControlAdv

Change the order of ToolStripTabItems

The ToolStripTabItem display index can be modified by reorganizing them in RibbonControlAdv.


void ChangeToolStripOrder()
     ArrayList toolStripTabitems = new ArrayList();
     foreach (Control ctrl in this.Controls)
         if (ctrl is RibbonControlAdv)
             RibbonControlAdv ribbonctrl = ctrl as RibbonControlAdv;
             foreach (object item in ribbonctrl.Header.MainItems)
                 if (item is ToolStripTabItem)
             int iterator = ribbonctrl.Header.MainItems.Count;
             while (iterator > 0)
                 iterator = ribbonctrl.Header.MainItems.Count;
             for (iterator = toolStripTabitems.Count-1; iterator >= 0; iterator--)
                 ribbonctrl.Header.AddMainItem(toolStripTabitems[iterator] as ToolStripTabItem);


Private Sub ChangeToolStripOrder()
     Dim toolStripTabitems As New ArrayList()
     For Each ctrl As Control In Me.Controls
         If TypeOf ctrl Is RibbonControlAdv Then
            Dim ribbonctrl As RibbonControlAdv = TryCast(ctrl, RibbonControlAdv)
            For Each item As Object In ribbonctrl.Header.MainItems
                If TypeOf item Is ToolStripTabItem Then
                End If
            Dim iterator As Integer = ribbonctrl.Header.MainItems.Count
            While iterator > 0
                    iterator = ribbonctrl.Header.MainItems.Count
            End While
            For iterator = toolStripTabitems.Count - 1 To 0 Step -1
                 ribbonctrl.Header.AddMainItem(TryCast(toolStripTabitems(iterator), ToolStripTabItem))
         Exit For
       End If
End Sub

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/RibbonControlAsmple720844179.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile