Stylus.StylusButtonDown 연결된 이벤트

정의

사용자가 스타일러스의 단추 중 하나를 누를 때 발생합니다.

see AddStylusButtonDownHandler, and RemoveStylusButtonDownHandler
see AddStylusButtonDownHandler, and RemoveStylusButtonDownHandler
see AddStylusButtonDownHandler, and RemoveStylusButtonDownHandler

예제

다음 예제에서는 사용자가 스타일러스의 배럴 단추를 누를 때 바로 가기 메뉴를 표시하는 방법을 보여 줍니다. 이 예제에서는 TextBox 라는 와 ContextMenu 라는 textBox1textBoxContextMenu가 있고 이벤트가 이벤트 처리기에 연결되어 있다고 StylusButtonDown 가정합니다.

// Show or hide a shortcut menu when the user clicks the barrel button.
void textbox1_StylusButtonDown(object sender, StylusButtonEventArgs e)
{
    if (e.StylusButton.Guid != StylusPointProperties.BarrelButton.Id)
    {
        return;
    }

    if (textbox1.ContextMenu == null)
    {
        textbox1.ContextMenu = textBoxContextMenu;
    }
    else
    {
        textbox1.ContextMenu = null;
    }
}
' Show or hide a shortcut menu when the user clicks the barrel button.
Private Sub textbox1_StylusButtonDown(ByVal sender As Object, ByVal e As StylusButtonEventArgs) _
    Handles textbox1.StylusButtonDown

    If e.StylusButton.Guid <> StylusPointProperties.BarrelButton.Id Then
        Return
    End If

    If textbox1.ContextMenu Is Nothing Then
        textbox1.ContextMenu = textBoxContextMenu
    Else
        textbox1.ContextMenu = Nothing
    End If

End Sub

설명

연결 된 이벤트입니다. WPF는 연결된 이벤트를 라우트된 이벤트로 구현합니다. 연결된 이벤트는 기본적으로 이벤트를 정의하지 않는 개체에서 처리되는 이벤트를 참조하는 데 사용되는 XAML 언어 개념입니다. WPF는 연결된 이벤트의 기능을 추가로 확장하여 경로를 트래버스할 수 있도록 합니다. 연결된 이벤트에는 코드에 직접 처리 구문이 없습니다. 코드에서 라우트된 이벤트에 대한 처리기를 연결하려면 지정된 Add*Handler 메서드를 사용합니다. 자세한 내용은 참조 하세요 연결 된 이벤트 개요합니다.

라우팅 이벤트 정보

식별자 필드 StylusButtonDownEvent
라우팅 전략 버블링
대리자 StylusButtonEventHandler

적용 대상

추가 정보