- Online Barcode Generator
- How To
- Buy Now
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 Design
WinForms UI Controls