Share via


StrokesEventHandler (Delegado)

Actualización: noviembre 2007

Representa el método que administra los eventos para agregar y quitar Strokes en el objeto Ink, en el objeto InkOverlay, en el control InkPicture y en la colección Strokes.

Espacio de nombres:  Microsoft.Ink
Ensamblado:  Microsoft.Ink (en Microsoft.Ink.dll)

Sintaxis

'Declaración
Public Delegate Sub StrokesEventHandler ( _
    sender As Object, _
    e As StrokesEventArgs _
)
'Uso
Dim instance As New StrokesEventHandler(AddressOf HandlerMethod)
public delegate void StrokesEventHandler(
    Object sender,
    StrokesEventArgs e
)
public delegate void StrokesEventHandler(
    Object^ sender, 
    StrokesEventArgs^ e
)
/** @delegate */
public delegate void StrokesEventHandler(
    Object sender,
    StrokesEventArgs e
)
JScript no admite delegados.

Parámetros

Comentarios

Cuando se crea un delegado de StrokesEventHandler, se identifica el método que controla el evento. Para asociarlo al controlador de eventos, se debe agregar al evento una instancia del delegado. Siempre que se produce el evento, se llama a su controlador, a menos que se quite el delegado.

El delegado de StrokesEventHandler se usa para implementar los controladores de eventos InkAdded, InkDeleted, StrokesAdded y StrokesRemoved.

Ejemplos

En este ejemplo, un controlador de eventos InkAdded escribe información sobre los trazos agregados a un control de cuadro de lista.

Private Sub Ink_InkAdded(ByVal sender As Object, ByVal e As StrokesEventArgs)
    ' since this event fires in all modes, we will check EditingMode
    ' and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Ink 
    If InkOverlayEditingMode.Ink = Me.mInkOverlay.EditingMode Then
        For Each id As Integer In e.StrokeIds
            Me.listBoxStrokeId.Items.Add("Added ID:" + id.ToString())
        Next
    End If
End Sub
private void Ink_InkAdded(object sender, StrokesEventArgs e)
{
    // since this event fires in all modes, we will check EditingMode
    // and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Ink 
    if (InkOverlayEditingMode.Ink == this.mInkOverlay.EditingMode)
    {
        foreach (int id in e.StrokeIds)
        {
            this.listBoxStrokeId.Items.Add("Added ID:" + id.ToString());

        }
    }
}

En este ejemplo, un controlador de eventos InkDeleted escribe información sobre los trazos eliminados de un control de cuadro de lista.

Private Sub Ink_InkDeleted(ByVal sender As Object, ByVal e As StrokesEventArgs)
    ' since this event fires in select mode also, we will check EditingMode
    ' and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete 
    If InkOverlayEditingMode.Delete = Me.mInkOverlay.EditingMode Then
        For Each id As Integer In e.StrokeIds
            Me.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString())
        Next
    End If
End Sub
private void Ink_InkDeleted(object sender, StrokesEventArgs e)
{
    // since this event fires in select mode also, we will check EditingMode
    // and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete 
    if (InkOverlayEditingMode.Delete == this.mInkOverlay.EditingMode)
    {
        foreach (int id in e.StrokeIds)
        {
            this.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString());

        }
    }
}

Plataformas

Windows Vista

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

Microsoft.Ink (Espacio de nombres)

Ink.InkAdded

Ink.InkDeleted

Strokes.StrokesAdded

Strokes.StrokesRemoved