C# Add and Remove Groups and Buttons of RibbonBar Control
KetticRibbonBar allows the users to add and remove RibbonBar groups and buttons at design time, as well as at run time in C# template projects. The RibbonBar groups and buttons adding and removing at run time in C# require the use of the appropriate objects and collections. In this article, we are going through the process of adding and removing RibbonBar groups and buttons in C#.NET application at run time.
C# Add a Button to RibbonBar group
When the designers of user interface of RibbonBar need to add a button to RibbonBar group in C# project at run time, they need to create a new KetticButtonElement and add the element to the KetticRibbonBarGroup.Items collection. The C# code below demonstrates the process of adding a button to KetticRibbonBarGroup at runtime.
Similarly, KetticRibbonBar control provides the AddRange method for the designers to add multiple buttons to KetticRibbonBarGroup at once at run time.
C# Remove a Button from RibbonBar group
If the designers want to remove a button from the KetticRibbonBar group, they need to call the Remove method of KetticRibbonBarGroup.Items collection and specify the KetticButtonElement that will be deleted.
KetticRibbonBar control offers the RemoveAt method for the designers to remove a button by index. The C# code below shows the process of removing a button from KetticRibbonBarGroup by index.
C# Add a Button Group with Buttons
KetticRibbonBar control allows the users to add a button group with buttons to a RibbonBar group. To achieve this, we need to create a new KetticRibbonBarButtonGroup object and customize the properties of this object, add the objects to the KetticButtonBarGroup.Items collection, and then add the KetticButtonBarGroup object to the KetticRibbonBarGroup.Items collection. The following C# code shows how to achieve this.
|
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 |