IRibbonControl.Tag Property

Definition

Used to store arbitrary strings and fetch them at runtime. Read-only

public:
 property System::String ^ Tag { System::String ^ get(); };
public string Tag { get; }
member this.Tag : string
Public ReadOnly Property Tag As String

Property Value

String

Examples

In the XML used to customize the Ribbon user interface, you can set a tag as follows. When the MyFunction action is called, you can read the Tag property, which will be equal to “some string”.

<span class="label">&lt;button id=”mybutton” tag=”some string” onAction=”MyFunction”/&gt;</span>

Remarks

Normally you can distinguish between controls in a Ribbon user interface XML customization file using the Id property. However, there are restrictions on what IDs can contain (no non-alphanumeric characters, and they must all be unique).

The Tag property doesn’t have these restrictions and so it can be used in the following situations, where ID doesn’t work:

Applies to