TX Text Control .NET for Windows Forms

Add Method

Method|Introduced in 24.0
Namespace
TXTextControl.Windows.Forms.Ribbon
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Adds a control of type RibbonButton, RibbonComboBox, RibbonLabel, RibbonListView, RibbonTextBox or RibbonSeperator to the end of a specific row inside the horizontal ribbon group.

Syntax

public int Add(Control item, int row);

Parameters

ParameterDescription
item

The control to be added to this group.

row

The row where to add the control. Valid values are 0, 1 or 2.

Return Value

The RibbonItems property's collection index at which the value has been added.

Examples

The following example adds an item to the horizontal ribbon group.

var result = horizontalRibbonGroup.Add(new System.Windows.Forms.Control(), 1);
Console.WriteLine($"Add result: {result}");

Limitations

RibbonButtons where the DisplayMode property is set to IconTextRelation.LargeIconLabeled cannot be added to a horizontal ribbon group.