ModifierKeys 列挙型
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
変換キーのセットを指定します。
この列挙体は、メンバー値のビットごとの組み合わせをサポートしています。
public enum class ModifierKeys
[System.ComponentModel.TypeConverter(typeof(System.Windows.Input.ModifierKeysConverter))]
[System.Flags]
public enum ModifierKeys
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Input.ModifierKeysConverter))>]
[<System.Flags>]
type ModifierKeys =
Public Enum ModifierKeys
- 継承
- 属性
名前 | 値 | 説明 |
---|---|---|
Alt | 1 | Alt キー。 |
Control | 2 | CTRL キー |
None | 0 | どの変換キーも押されていません。 |
Shift | 4 | Shift キー |
Windows | 8 | Windows ロゴ キー |
次の例では、 を に関連付ける を KeyBinding 作成する KeyGesture 方法を RoutedCommand示します。 では KeyBinding 、 列挙を ModifierKeys 使用してジェスチャの修飾子キーを指定します。
<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);
' Creating a KeyBinding between the Open command and Ctrl-R
Dim OpenCmdKeyBinding As New KeyBinding(ApplicationCommands.Open, Key.R, ModifierKeys.Control)
Me.InputBindings.Add(OpenCmdKeyBinding)
クラスの Keyboard プロパティはModifiers、現在押されている修飾子キーのセットです。
列挙体を使用する Windows Presentation Foundation (WPF) の一部の ModifierKeys API はModifiers、および MouseGesture クラスのKeyboardKeyBindingKeyGestureプロパティです。
<object property="oneOrMoreModifierKeys"/>
oneOrMoreModifierKeys
列挙体によって定義される 1 つ以上の ModifierKeys 修飾子キーは、"+" 文字で区切られます。
製品 | バージョン |
---|---|
.NET Framework | 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 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。