Stylus.LostStylusCapture Evento adjunto
Definición
Se produce cuando un elemento libera eventos de lápiz.Occurs when an element releases stylus events.
see AddLostStylusCaptureHandler, and RemoveLostStylusCaptureHandler
see AddLostStylusCaptureHandler, and RemoveLostStylusCaptureHandler
see AddLostStylusCaptureHandler, and RemoveLostStylusCaptureHandler
Ejemplos
En el ejemplo siguiente se muestra cómo cambiar el color de fondo TextBox de una TextBox cuando captura y libera eventos del lápiz óptico.The following example demonstrates how to change the background color of a TextBox when the TextBox captures and releases stylus events. En este ejemplo se da por supuesto que hay textBox1
un TextBox denominado y GotStylusCapture que LostStylusCapture los eventos y están conectados a los controladores de eventos en el ejemplo.This example assumes that there is a textbox called textBox1
, and that the GotStylusCapture and LostStylusCapture events are connected to the event handlers in the example.
void textbox1_LostStylusCapture(object sender, StylusEventArgs e)
{
textbox1.Background = Brushes.White;
}
void textbox1_GotStylusCapture(object sender, StylusEventArgs e)
{
textbox1.Background = Brushes.Red;
}
Private Sub textbox1_LostStylusCapture(ByVal sender As Object, ByVal e As StylusEventArgs) _
Handles textbox1.LostStylusCapture
textbox1.Background = Brushes.White
End Sub
Private Sub textbox1_GotStylusCapture(ByVal sender As Object, ByVal e As StylusEventArgs) _
Handles textbox1.GotStylusCapture
textbox1.Background = Brushes.Red
End Sub
Comentarios
Se trata de un evento adjunto.This is an attached event. WPFWPFimplementa los eventos adjuntos como eventos enrutados.implements attached events as routed events. Un evento adjunto es, fundamentalmente, un XAMLXAML concepto de lenguaje que se usa para hacer referencia a los eventos que se administran en objetos que no, ellos mismos, definen eventos.An attached event is, fundamentally, a XAMLXAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPFWPFexpande aún más las capacidades de un evento adjunto, permitiéndole atravesar una ruta.further expands an attached event's capabilities, allowing it to traverse a route. Los eventos adjuntos no tienen una sintaxis de control directo en el código; para adjuntar controladores para un evento enrutado en el código, use un método de controlador Add * designado.Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, use a designated Add*Handler method. Para obtener más información, vea información general sobre eventosadjuntos.For details, see Attached Events Overview.
Información sobre eventos enrutadosRouted Event Information
Campo de identificadorIdentifier field | LostStylusCaptureEvent |
Estrategia de enrutamientoRouting strategy | PropagaciónBubbling |
delegadoDelegate | StylusEventHandler |