Articles in this section
Category / Section

How to add or remove MainTabItem through code in WinForms RibbonControlAdv?

1 min read

Add or remove tabitem

To add ToolStripTabItems to the RibbonControlAdv, RibbonControlAdv.Header.AddMainItem method can be used.

C#

ToolStripTabItem toolStripTabItem = new ToolStripTabItem();
toolStripTabItem.Text = this.comboBox1.Text;
this.ribbonControlAdv1.Header.AddMainItem(toolStripTabItem);

VB

Dim toolStripTabItem As ToolStripTabItem = New ToolStripTabItem()
toolStripTabItem.Text = Me.comboBox1.Text
Me.ribbonControlAdv1.Header.AddMainItem(toolStripTabItem)

To remove ToolStripTabItems from the RibbonControlAdv, RibbonControlAdv.Header.MainItems.RemoveAt method can be used. The index of the item to be removed should be passed to this method.

C#

this.ribbonControlAdv1.Header.MainItems.RemoveAt(count);

VB

Me.ribbonControlAdv1.Header.MainItems.RemoveAt(count)

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied