KeyBinding..::.Modifiers Property
This page is specific to:.NET Framework Version:3.03.54.0
.NET Framework Class Library
KeyBinding..::.Modifiers Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

'Usage

Dim instance As KeyBinding
Dim value As ModifierKeys

value = instance.Modifiers

instance.Modifiers = value

'Declaration

Public Property Modifiers As ModifierKeys
    Get
    Set
<object Modifiers="oneOrMoreModifierKeys"/>

XAML Values

oneOrMoreModifierKeys

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

Property Value

Type: System.Windows.Input..::.ModifierKeys
The modifier keys of the KeyGesture. The default value is None.
Remarks

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

When defining a KeyBinding in Extensible Application Markup Language (XAML) there are two ways to specify the KeyGesture. The first way to establish a KeyBinding in XAML is to define the Gesture attribute of the KeyBinding element, which enables a syntax to specify keys and modifiers as a single string, for example "CTRL+P". The second way is to define the Key attribute and the Modifiers attributes of the KeyBinding element. Both ways of setting the KeyGesture are equivalent and modify the same underlying object, but there will be a conflict if both are used. In the case when the Key, Modifiers, and the Gesture attributes are all set, the attribute which is defined last will be used for the KeyGesture. You can potentially have situations where for example a Key set last will overwrite just the Key component of a preceding Gesture but leave the Gesture's modifiers the same. In general, it is recommended that you use only the Gesture attribute from XAML; this will avoid ambiguity, provides the most streamlined syntax, and provides the most straightforward representation for serialization.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4
See Also

Reference

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View