C# Add and Remove Tabs and RibbonBar Groups
KetticRibbonBar not only allows the users to add and remove tabs and RibbonBar groups at design time, but also at run time in C# code. The tabs and RibbonBar groups adding and removing at run time in C# template projects requires the use of the appropriate collections. In this article, we are going through the process of adding and removing tabs and RibbonBar groups in C#.NET application at run time.
C# Add a Tab in KetticRibbonBar Control
When the designers of user interface of RibbonBar need to add a tab to KetticRibbonBar in C# project at run time, they need to create a new Kettic.WinForms.UI.RibbonTab object and customize the properties of the object. Then call the Add method of the KetticRibbonBar.CommandTabs collection and pass the Kettic.WinForms.UI.RibbonTab object. The C# code below shows how to achieve this.
If the designers want to add multiple tabs at once, they need to call the AddRange method of KetticRibbonBar.CommandTabs collection by using the C# code below.
C# Remove a Tab from KetticRibbonBar
When the designers of RibbonBar user interface need to remove a tab, they need to call the Remove method of the CommandTabs collection and then specify the RibbonTab that will be deleted. The C# code below shows how to delete a tab from KetticRibbonBar control at runtime.
The KetticRibbonBar control offers a RemoveAt method for the designers to delete a tab by index. The C# code below shows how to remove a tab by index at runtime in C# template project.
C# Add a KetticRibbonBar Group at Runtime
To add a RibbonBar group to a tab, the designers of RibbonBar UI need to create a new KetticRibbonBarGroup object and customize the properties of the object. Then call the Add method of the KetticRibbonBar.CommandTab.Items collection and pass the KetticRibbonBarGroup object to it. The C# code below shows how to create a RibbonBar group and set it.
When the designers want to add multiple RibbonBar groups at once, they need to call the AddRange method of KetticRibbonBar.CommandTab.Items collection by using the C# code below.
C# Remove a KetticRibbonBar Group
When the user interface designers of RibbonBar need to remove a RibbonBar group in C# project at runtime, they need to call the Remove method of the CommandTabs collection and then specify the KetticRibbonBarGroup that will be removed. The C# code below shows how to delete a RibbonBarGroup from KetticRibbonBar control at runtime.
The KetticRibbonBar control offers a RemoveAt method for the interface designers of ribbon bar to remove a RibbonBar group by index. The C# code below shows how to remove a RibbonBar group by index at runtime in C# template project.
| ![]() UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlRibbon - Get Started in C#StructureCustomizationStart Menu and ShortcutsAdd and Remove Tabs & GroupsAdd and Remove Groups & ButtonsUse Different ElementsAdd Other ControlsContextual Tab GroupsStart Menu CustomizationQuick Access ToolbarCreate GalleryAdd Screen TipsAdd Key TipsUsing Large & Small ImagesDrag & drop to Move ItemsRibbon - StructureRibbon - C# ProgrammingAdd and Remov Tabs and GroupsAdd and Remov Groups and ButtonsAdd and and Customize ElementsManage Contextual Tab GroupsCustomize Application MenuCustomize Quick Access MenuRibbon - Backstage ViewGet Started in C#Customizing in C#Ribbon - End-User CapabilitiesCollapse the RibbonUsing Key TipsRibbon - LocalizationRight to Left SupportWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |