Stylus.GotStylusCapture Evento adjunto
Definición
Se produce cuando un elemento captura los eventos de lápiz.Occurs when an element captures the stylus events.
see AddGotStylusCaptureHandler, and RemoveGotStylusCaptureHandler
see AddGotStylusCaptureHandler, and RemoveGotStylusCaptureHandler
see AddGotStylusCaptureHandler, and RemoveGotStylusCaptureHandler
Ejemplos
En el ejemplo siguiente se muestra cómo cambiar el color de fondo de una TextBox cuando TextBox 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 un TextBox denominado y textBox1
que los GotStylusCapture LostStylusCapture eventos y están conectados a los controladores de eventos.This example assumes that there is a textbox called textBox1
, and that the GotStylusCapture and LostStylusCapture events are connected to event handlers.
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. WPFWPF implementa los eventos adjuntos como eventos enrutados.implements attached events as routed events. Los eventos adjuntos son, fundamentalmente, un concepto de lenguaje que se XAMLXAML usa para hacer referencia a los eventos que se administran en objetos que no, ellos mismos, definen eventos.Attached events are, fundamentally, a XAMLXAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPFWPFAmplía aún más las capacidades de un evento adjunto, permitiéndole atravesar una ruta.The WPFWPF 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 eventos adjuntos.For details, see Attached Events Overview.
Información sobre eventos enrutadosRouted Event Information
Campo de identificadorIdentifier field | GotStylusCaptureEvent |
Estrategia de enrutamientoRouting strategy | PropagaciónBubbling |
DelegadoDelegate | StylusEventHandler |