[]
Gets or sets the RibbonItem at the specified position in the collection.
public RibbonItem this[int index] { get; set; }
Public Default Property Item(index As Integer) As RibbonItem
| Type | Name | Description |
|---|---|---|
| int | index | Index of the item. |
| Type | Description |
|---|---|
| RibbonItem | The RibbonItem at the specified |
Gets the first RibbonItem with the specified name.
public RibbonItem this[string name] { get; }
Public ReadOnly Default Property Item(name As String) As RibbonItem
| Type | Name | Description |
|---|---|---|
| string | name | String containing the name of the item to locate (case-sensitive). |
| Type | Description |
|---|---|
| RibbonItem | The RibbonItem with the specified |
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.
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"];