[]
        
(Showing Draft Content)

C1.Win.Ribbon.RibbonItemCollection.Item

this Property

this[int]

Gets or sets the RibbonItem at the specified position in the collection.

Declaration
public RibbonItem this[int index] { get; set; }
Parameters
Type Name Description
int index

Index of the item.

Property Value
Type Description
RibbonItem

The RibbonItem at the specified index.

this[string]

Gets the first RibbonItem with the specified name.

Declaration
public RibbonItem this[string name] { get; }
Parameters
Type Name Description
string name

String containing the name of the item to locate (case-sensitive).

Property Value
Type Description
RibbonItem

The RibbonItem with the specified name.

Remarks

If an item with the specified name is not found, an ArgumentOutOfRangeException exception is thrown.

This method can be used to retrieve RibbonItem objects that are contained in RibbonToolBar objects, and are not direct members of the collection.

Examples

The example below shows how to get a reference to a RibbonItem using its name:

// get the group that contains the button
RibbonGroup g = c1Ribbon1.Tabs["Editor"].Groups["Font"];

// get the button within the group
RibbonToggleButton btn = (RibbonToggleButton)g.Items["BoldButton"];