Share via


InkOverlay.StrokesDeleted (Evento)

Actualización: noviembre 2007

Se produce una vez eliminados de la propiedad InkOverlay.Ink uno o más objetos Stroke.

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

Sintaxis

'Declaración
Public Event StrokesDeleted As InkOverlayStrokesDeletedEventHandler
'Uso
Dim instance As InkOverlay
Dim handler As InkOverlayStrokesDeletedEventHandler

AddHandler instance.StrokesDeleted, handler
public event InkOverlayStrokesDeletedEventHandler StrokesDeleted
public:
 event InkOverlayStrokesDeletedEventHandler^ StrokesDeleted {
    void add (InkOverlayStrokesDeletedEventHandler^ value);
    void remove (InkOverlayStrokesDeletedEventHandler^ value);
}
/** @event */
public void add_StrokesDeleted (InkOverlayStrokesDeletedEventHandler value)
/** @event */
public void remove_StrokesDeleted (InkOverlayStrokesDeletedEventHandler value)
JScript no admite eventos.

Comentarios

Este evento se desencadena al llamar al método Ink.DeleteStrokes o Ink.DeleteStroke de la entrada manuscrita asociada a un objeto InkOverlay.

El controlador de eventos recibe un argumento de tipo EventArgs que no contiene datos.

Ejemplos

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

Cuando se desencadena el evento Stoke(), se examina la propiedad EditingMode. Si actualmente se encuentra en el modo de 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 se desencadena el evento StrokesDeleted, 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á al 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

InkOverlay (Clase)

InkOverlay (Miembros)

Microsoft.Ink (Espacio de nombres)

InkOverlay.Ink

InkOverlay.StrokesDeleting

Otros recursos

System.EventArgs