Stylus.PreviewStylusInRange Evento anexado

Definição

Ocorre quando a caneta fica dentro do alcance do tablet.

see AddPreviewStylusInRangeHandler, and RemovePreviewStylusInRangeHandler
see AddPreviewStylusInRangeHandler, and RemovePreviewStylusInRangeHandler
see AddPreviewStylusInRangeHandler, and RemovePreviewStylusInRangeHandler

Exemplos

O exemplo a seguir demonstra como determinar se a caneta está invertida. Este exemplo pressupõe que há um TextBox chamado textBox1 e que o PreviewStylusInRange evento está conectado aos manipuladores de eventos.

void textbox1_PreviewStylusInRange(object sender, StylusEventArgs e)
{
    if (e.StylusDevice.Inverted)
    {
        textbox1.AppendText("Pen is inverted\n");
    }
    else
    {
        textbox1.AppendText("Pen is not inverted\n");
    }
}
Private Sub textbox1_PreviewStylusInRange(ByVal sender As Object, _
    ByVal e As StylusEventArgs) Handles textbox1.PreviewStylusInRange

    If e.StylusDevice.Inverted Then
        textbox1.AppendText("Pen is inverted" & vbLf)
    Else
        textbox1.AppendText("Pen is not inverted" & vbLf)
    End If

End Sub

Comentários

Este é um evento anexado. O WPF implementa eventos anexados como eventos roteados. Um evento anexado é, fundamentalmente, um conceito de linguagem XAML usado para referenciar eventos que são manipulados em objetos que não definem eventos. O WPF expande ainda mais os recursos de um evento anexado, permitindo que ele percorra uma rota. Os eventos anexados não têm uma sintaxe de manipulação direta no código; para anexar manipuladores para um evento roteado no código, use um método Add*Handler designado. Para obter detalhes, consulte Visão geral de eventos anexados.

Informações de evento encaminhado

Campo Identificador PreviewStylusInRangeEvent
Estratégia de roteamento Túnel
Delegar StylusEventHandler

Aplica-se a

Confira também