TX Text Control .NET for Windows Forms

Insert 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

Inserts a control of the type RibbonButton, RibbonComboBox, RibbonLabel, RibbonListView, RibbonTextBox or RibbonSeperator at the specified index.

Syntax

public void Insert(int index, Control item);

Parameters

ParameterDescription
index

The zero-based index at which the control should be inserted.

item

The control to be inserted.

Examples

The following example uses Insert in a focused Ribbon Item Collection workflow. The created object is then available to the surrounding document workflow.

ribbonItemCollection.Insert(1, new System.Windows.Forms.Control());
Console.WriteLine("Ribbon Item Collection is ready for use.");

Limitations

If the RibbonItemCollection is optained by a HorizontalRibbonGroup controls are inserted 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 inserted.