Stylus.PreviewStylusInRange Evento Anexado

Definição

Ocorre quando a caneta se aproxima do alcance do tablet.

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

Exemplos

O exemplo seguinte demonstra como determinar se a agulha está invertida. Este exemplo assume que existe uma TextBox chamada textBox1 e que o PreviewStylusInRange evento está ligado aos handlers 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

Observações

Este é um evento anexado. O WPF implementa eventos anexos como eventos encaminhados. Um evento associado é, fundamentalmente, um conceito de linguagem XAML usado para referenciar eventos que são tratados em objetos que, por si só, não definem eventos. O WPF expande ainda mais as capacidades de um evento anexado, permitindo-lhe percorrer uma rota. Os eventos anexados não têm uma sintaxe de tratamento direta no código; para anexar handlers para um evento encaminhado no código, use um método designado Add*Handler. Para mais detalhes, consulte a Visão Geral dos Eventos em Anexo.

Informação sobre Eventos Roteados

Iteme Value
Campo identificador PreviewStylusInRangeEvent
Estratégia de encaminhamento Tunneling
Delegar StylusEventHandler

Aplica-se a

Ver também