Add Method
- Namespace
TXTextControl.Windows. Forms. Ribbon
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesWindows. Forms. dll
Description
Adds a control of the type RibbonButton, RibbonComboBox, RibbonLabel, RibbonListView, RibbonTextBox or RibbonSeperator to the end of the collection.
Syntax
public int Add(Control item);Public Function Add(item As Control) As IntegerParameters
| Parameter | Description |
|---|---|
| item | The control to be added to the end of this collection. |
Return Value
The collection's index at which the value has been added.
Examples
The following example adds an item to the ribbon item collection.
var result = ribbonItemCollection.Add(new System.Windows.Forms.Control());
Console.WriteLine($"Add result: {result}");Dim result = ribbonItemCollection.Add(New System.Windows.Forms.Control())
Console.WriteLine($"Add result: {result}")Limitations
If the RibbonItemCollection is optained by a HorizontalRibbonGroup controls are added to the group's first row.
If the RibbonItemCollection is optained by a HorizontalRibbonGroup RibbonButtons where the DisplayMode property is set to IconTextRelation.LargeIconLabeled cannot be added.