Command.Keytip property

Represents the keytip for a control.


  child elements


There are no attributes.

Child elements



May occur at most once

Parent elements





May occur at most once for each Command element.

Command.Keytip can contain a value of type xs:string constrained to any sequence of Unicode characters, including white space.

A Command.Keytip can begin with a number only when associated with a control within a Tab or the Quick Access Toolbar.

To display the keytips that are valid for the current state of the ribbon, press and hold the ALT key. The following screen shot shows the initial, or first level, keytips that are displayed in Microsoft Paint for Windows 7. After a first-level keytip has been selected, only second-level keytips are displayed.

First-level keytips in Microsoft Paint for Windows 7

Command.Keytip acts as the keyboard accelerator for a command unless that command is exposed through a menu item. In this case, the framework ignores the Command.Keytip value and instead uses a character preceded by an ampersand as specified by Command.LabelTitle or UI_PKEY_Label. If no ampersand is specified by Command.LabelTitle or UI_PKEY_Label, no keytip or keyboard accelerator is exposed.

If no value is supplied for Command.Keytip, the String child element is required.

Note  If Command.Keytip contains both a value and a String child element, String takes precedence.

By default, the following letters are used by the framework to automatically generate keytips:

Note  None of these letters are reserved by the framework. Each can be assigned to one or more commands as required.

The framework resolves keytip conflicts in the following ways:

  • If one or more Tab controls are associated with the same keytip, a number is appended to each keytip, starting at 1, and increasing sequentially (2, 3,...) for each control in the order of declaration. If any Tab controls are assigned the letter F as a keytip, the Application Menu is assigned F1 with the remaining keytips adjusted as described.
  • When associated with a single control within a Tab, the keytip F is valid for both the control and the Application Menu. The default Application Menu keytip is not changed, but precedence is given to the control on the active tab.
  • If one or more controls within a Tab are associated with the same keytip, the framework automatically refactors the keytips of those controls, as described previously.
Note  A slight variation in text color is used to highlight refactored keytips in a standard ribbon implementation. For a nonstandard ribbon implementation where the ribbon color has been customized, this framework behavior is overridden and all keytips are displayed with the same text color. For more information, see Customizing Ribbon Colors.

The maximum length is unbounded.


The following example demonstrates the markup for a Command element with a Command.Keytip declaration.

      <String.Content>Label for Save</String.Content>
  <Command.TooltipTitle>Tooltip title with &amp;&amp; for Save Command</Command.TooltipTitle>
  <Command.TooltipDescription>Tooltip description for Save Command.</Command.TooltipDescription>


Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

See also




Community Additions