다음을 통해 공유


KeyGesture 생성자

정의

KeyGesture 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
KeyGesture(Key)

지정된 클래스를 사용하여 클래스의 KeyGesture 새 인스턴스를 초기화합니다 Key.

KeyGesture(Key, ModifierKeys)

지정된 클래스와 .를 사용하여 클래스의 KeyGesture 새 인스턴스를 Key 초기화합니다 ModifierKeys.

KeyGesture(Key, ModifierKeys, String)

지정된 KeyModifierKeys문자열을 사용하여 클래스의 KeyGesture 새 인스턴스를 초기화하고 문자열을 표시합니다.

KeyGesture(Key)

지정된 클래스를 사용하여 클래스의 KeyGesture 새 인스턴스를 초기화합니다 Key.

public:
 KeyGesture(System::Windows::Input::Key key);
public KeyGesture(System.Windows.Input.Key key);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key -> System.Windows.Input.KeyGesture
Public Sub New (key As Key)

매개 변수

key
Key

이 제스처와 연결된 키입니다.

예외

key 유효한 Key아닙니다.

key 유효한 KeyGesture아닙니다.

예제

다음 예제에서는이 생성자를 만들고 KeyGestureKeyBinding연결 하는 방법을 보여 있습니다. 그런 다음 , KeyBinding 에 추가 InputBindingCollection 됩니다 Window.

KeyGesture OpenCmdKeyGesture = new KeyGesture(Key.F12);
KeyBinding OpenKeyBinding = new KeyBinding(
    ApplicationCommands.Open,
    OpenCmdKeyGesture);

this.InputBindings.Add(OpenKeyBinding);
Dim OpenCmdKeyGesture As New KeyGesture(Key.F12)
Dim OpenKeyBinding As New KeyBinding(ApplicationCommands.Open, OpenCmdKeyGesture)

Me.InputBindings.Add(OpenKeyBinding)

설명

대부분의 경우 A는 KeyGesture 하나 이상 ModifierKeys과 연결되어야 합니다. 이 규칙의 예외는 함수 키와 숫자 키패드 키이며, 이는 자체적으로 유효 KeyGesture 할 수 있습니다.

추가 정보

적용 대상

KeyGesture(Key, ModifierKeys)

지정된 클래스와 .를 사용하여 클래스의 KeyGesture 새 인스턴스를 Key 초기화합니다 ModifierKeys.

public:
 KeyGesture(System::Windows::Input::Key key, System::Windows::Input::ModifierKeys modifiers);
public KeyGesture(System.Windows.Input.Key key, System.Windows.Input.ModifierKeys modifiers);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key * System.Windows.Input.ModifierKeys -> System.Windows.Input.KeyGesture
Public Sub New (key As Key, modifiers As ModifierKeys)

매개 변수

key
Key

제스처와 연결된 키입니다.

modifiers
ModifierKeys

제스처와 연결된 한정자 키입니다.

예외

modifiers 가 잘못되었습니다. ModifierKeys

-또는-

key 유효한 Key아닙니다.

key 유효한 modifiersKeyGesture형식을 지정하지 않습니다.

예제

다음 예제에서는이 생성자를 만들고 KeyGestureKeyBinding연결 하는 방법을 보여 있습니다. 그런 다음 , KeyBinding 에 추가 InputBindingCollection 됩니다 Window.

KeyGesture CloseCmdKeyGesture = new KeyGesture(
    Key.L, ModifierKeys.Alt);

KeyBinding CloseKeyBinding = new KeyBinding(
    ApplicationCommands.Close, CloseCmdKeyGesture);

this.InputBindings.Add(CloseKeyBinding);
Dim CloseCmdKeyGesture As New KeyGesture(Key.L, ModifierKeys.Alt)

Dim CloseKeyBinding As New KeyBinding(ApplicationCommands.Close, CloseCmdKeyGesture)

Me.InputBindings.Add(CloseKeyBinding)

설명

대부분의 경우 A는 KeyGesture 하나 이상 ModifierKeys과 연결되어야 합니다. 이 규칙의 예외는 함수 키와 숫자 키패드 키이며, 이는 자체적으로 유효 KeyGesture 할 수 있습니다.

추가 정보

적용 대상

KeyGesture(Key, ModifierKeys, String)

지정된 KeyModifierKeys문자열을 사용하여 클래스의 KeyGesture 새 인스턴스를 초기화하고 문자열을 표시합니다.

public:
 KeyGesture(System::Windows::Input::Key key, System::Windows::Input::ModifierKeys modifiers, System::String ^ displayString);
public KeyGesture(System.Windows.Input.Key key, System.Windows.Input.ModifierKeys modifiers, string displayString);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key * System.Windows.Input.ModifierKeys * string -> System.Windows.Input.KeyGesture
Public Sub New (key As Key, modifiers As ModifierKeys, displayString As String)

매개 변수

key
Key

제스처와 연결된 키입니다.

modifiers
ModifierKeys

제스처와 연결된 한정자 키입니다.

displayString
String

의 문자열 표현입니다 KeyGesture.

예외

modifiers 가 잘못되었습니다. ModifierKeys

-또는-

key 유효한 Key아닙니다.

displayStringnull입니다.

key 유효한 modifiersKeyGesture형식을 지정하지 않습니다.

설명

속성이 DisplayString 매개 변수로 설정됩니다 displayString .

추가 정보

적용 대상