Share via


InkOverlayStrokesDeletedEventHandler (Delegado)

Actualización: noviembre 2007

Representa el método que controla el evento StrokesDeleted de un objeto InkOverlay.

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

Sintaxis

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

Parámetros

Comentarios

El evento StrokesDeleted se produce una vez eliminados de la propiedad Ink los objetos Stroke.

La clase EventArgs no contiene datos de evento. La usan los eventos que no pasan información de estado a un controlador de eventos cuando se provoca un evento.

Ejemplos

En este ejemplo se muestra cómo puede suscribirse al evento Stoke() y el evento StrokesDeleted para modificar el color de fondo del control en el que se representa la entrada manuscrita.

Cuando el evento Stoke() se desencadena, se examina la propiedad EditingMode. Si actualmente se encuentra en modo Entrada manuscrita, el color de fondo del control cambiará a blanco. Debe comprobar la propiedad EditingMode porque el evento Stoke() también se desencadena al borrar trazos.

Private Sub mInkObject_Stroke3(ByVal sender As Object, ByVal e As InkCollectorStrokeEventArgs)
    ' If you are in inking mode, change background to white.
    ' (This event will also fire in Delete mode because the movement made by
    ' the eraser is considered a stroke.)
    If (InkOverlayEditingMode.Ink = mInkObject.EditingMode) Then
        mInkObject.AttachedControl.BackColor = Color.White
    End If
End Sub
private void mInkObject_Stroke3(object sender, InkCollectorStrokeEventArgs e)
{
    // If you are in inking mode, change background to white.
    // (This event will also fire in Delete mode because the movement made by
    // the eraser is considered a stroke.)
    if (InkOverlayEditingMode.Ink == mInkObject.EditingMode)
    {
        mInkObject.AttachedControl.BackColor = Color.White;
    }

}

Cuando el evento StrokesDeleted se desencadena, se examina la colección Stokes(). Si no hay ningún objeto Stroke en la colección (o sólo queda el trazo del borrador), el color de fondo del control cambiará a color gris.

Private Sub mInkObject_StrokesDeleted(ByVal sender As Object, ByVal e As EventArgs)
    ' Change the background to gray if there are no strokes.
    ' If the last stroke was deleted by an eraser, there will be one transparent 
    ' stroke, which is the stroke made by the eraser itself.
    If (mInkObject.Ink.Strokes.Count = 0 Or _
       (mInkObject.Ink.Strokes.Count = 1 And _
        mInkObject.Ink.Strokes(0).DrawingAttributes.Transparency = 255)) Then

        mInkObject.AttachedControl.BackColor = Color.Gray

    End If
End Sub
private void mInkObject_StrokesDeleted(object sender, EventArgs e)
{
    // Change the background to gray if there are no strokes.
    // If the last stroke was deleted by an eraser, there will be one transparent 
    // stroke, which is the stroke made by the eraser itself.
    if (mInkObject.Ink.Strokes.Count == 0 ||
       (mInkObject.Ink.Strokes.Count == 1 &&
        mInkObject.Ink.Strokes[0].DrawingAttributes.Transparency == 255))
    {
        mInkObject.AttachedControl.BackColor = Color.Gray;
    }

}

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)

InkOverlay.Ink

Otros recursos

System.EventArgs