This documentation is archived and is not being maintained.

InkOverlayStrokesDeletedEventHandler Delegate

Represents the method that handles the StrokesDeleted event of an InkOverlay object.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

public delegate void InkOverlayStrokesDeletedEventHandler(
	Object sender,
	EventArgs e


Type: System.Object

The source InkOverlay of this event.

Type: System.EventArgs

The EventArgs object that contains the event data.

The StrokesDeleted event occurs after Stroke objects have been deleted from the Ink property.

The EventArgs class contains no event data. It is used by events that do not pass state information to an event handler when an event is raised.

This example demonstrates how you can subscribe to the Stoke event, and the StrokesDeleted event to modify the background color of the control on which ink is rendered.

When the Stoke event fires, the EditingMode property is examined. If currently in Ink mode, the background color of the control is changed to white. You must check the EditingMode property because the Stoke event fires also when erasing stokes.

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;


When the StrokesDeleted event fires, the Stokes collection is examined. If there are no Stroke objects in the collection (or only the stoke of the eraser remains), the background color of the control is changed to gray.

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;


Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.0