ToolStripMenuItem.ShortcutKeyDisplayString Property

Definition

Gets or sets the shortcut key text.

C#
public string ShortcutKeyDisplayString { get; set; }
C#
public string? ShortcutKeyDisplayString { get; set; }

Property Value

A String representing the shortcut key.

Examples

The following example assigns the specified text to the ShortcutKeyDisplayString. This example is part of a larger example available in the ToolStripManager class overview.

C#
// Distinguish the merged items by setting the shortcut display string.
foreach (ToolStripMenuItem tsmi in cmsItemsToMerge.Items)
{
    tsmi.ShortcutKeyDisplayString = "Merged Item";
}

Remarks

Use this property to get or set the text that is displayed as the shortcut key.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10