For Ribbon controls

Applies to

Ribbon controls (including RibbonApplicationButtonItem, RibbonTabButtonItem, RibbonCategoryItem, RibbonPanelItem, RibbonLargeButtonItem, RibbonSmallButtonItem, RibbonCheckBoxItem, RibbonComboBoxItem, and RibbonMenuItem)

Description

The Text property specifies the text displayed in the menu object or control.

For RibbonMenuItem, the user can assign an accelerator key by typing an ampersand (&) before the letter in the menu item text. For example, &File designates the F in File as an accelerator key. If you specify the accelerator key in the XML file, use the escape character "&" to replace "&". The user can also assign shortcut keys to ribbon menus, see Shortcut for details.

For RibbonTabButtonItem, the text will be shown when the PictureName property for RibbonTabButtonItem is not set.

For RibbonComboBoxItem, the text will be shown in the text box of the ComboBox when the AllowEdit property for RibbonComboBoxItem is set to true.

Usage

In scripts

The Text property takes a string value. The following line specifies &Open as the menu text with the O underlined as the accelerator key:

RibbonMenuItem lnv_menuItem
lnv_menuItem.Text ="&Open"

In the XML file

You can also specify the accelerator key in the XML file. Note that you must use the escape character "&" instead of "&".

<ApplicationMenu>
 <Master>
   <Item Text="Help" Enabled="true"  Visible="true" PictureName="HelpBig!" Checked="false" Type="0">
     <Item Text="&amp;About" Enabled="true" Tag="About" Visible="true" PictureName="AboutBig!" Checked="false" Type="0" Clicked="ue_about" Shortcut="ctrl+alt+a"/>
   </Item>
   <Item Text="&amp;Exit" Enabled="true" Tag="Exit" Visible="true" PictureName="SignOutBig!" Checked="false" Type="0" Clicked="ue_exit"/>
 </Master>        
</ApplicationMenu>