Export (0) Print
Expand All

KeyBinding.Modifiers Property

Gets or sets the ModifierKeys of the KeyGesture associated with this KeyBinding.

Namespace: System.Windows.Input
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

'Declaration
Public Property Modifiers As ModifierKeys
'Usage
Dim instance As KeyBinding
Dim value As ModifierKeys

value = instance.Modifiers

instance.Modifiers = value
/** @property */
public ModifierKeys get_Modifiers ()

/** @property */
public void set_Modifiers (ModifierKeys value)

public function get Modifiers () : ModifierKeys

public function set Modifiers (value : ModifierKeys)

<object Modifiers="oneOrMoreModifierKeys"/>

 oneOrMoreModifierKeys  One or more modifier keys, defined by the ModifierKeys enumeration, delimited with a "+" character.   

Property Value

The modifier keys of the KeyGesture. The default value is None.

With the exception of the function keys and the numeric keypad keys, a KeyGesture must contain a Key and one or more ModifierKeys.

The following example creates a KeyBinding and adds it to the InputBindingCollection of the root window.

<Window.InputBindings>
  <KeyBinding Command="ApplicationCommands.Open"
              Gesture="CTRL+R" />
</Window.InputBindings>

// Creating a KeyBinding between the Open command and Ctrl-R
KeyBinding OpenCmdKeyBinding = new KeyBinding(
    ApplicationCommands.Open, 
    Key.R, 
    ModifierKeys.Control);

this.InputBindings.Add(OpenCmdKeyBinding);

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

Community Additions

ADD
Show:
© 2014 Microsoft