This documentation is archived and is not being maintained.

MenuItem.InputGestureText Property

Sets the text describing an input gesture that will call the command tied to the specified item.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[BindableAttribute(true)] 
public string InputGestureText { get; set; }
/** @property */
public String get_InputGestureText ()

/** @property */
public void set_InputGestureText (String value)

public function get InputGestureText () : String

public function set InputGestureText (value : String)

<object InputGestureText="string" .../>

Property Value

Text that describes the input gesture, such as Ctrl+C for the Copy command. Default value is an empty string.

This property does not associate the input gesture with the menu item it simply adds text to the menu item. For information on how to associate a command with a menu item see: Command.

The following examples show how to use the InputGestureText property to assign keyboard shortcuts text to menu items.

<MenuItem Header="_Cut" InputGestureText="Ctrl+X"/>
<MenuItem Header="_Find" InputGestureText="Ctrl+F"/>

mia = new MenuItem();
mia.Header = "_Cut";
mia.InputGestureText = "Ctrl+X";
mi.Items.Add(mia);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: