Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InkCanvas.StrokeErasing Event

Occurs just before a user erases a strokes

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public event InkCanvasStrokeErasingEventHandler StrokeErasing
/** @event */
public void add_StrokeErasing (InkCanvasStrokeErasingEventHandler value)

/** @event */
public void remove_StrokeErasing (InkCanvasStrokeErasingEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
<object StrokeErasing="InkCanvasStrokeErasingEventHandler" .../>

Handle this event when you want to check whether a stroke should be erased. Set the Cancel property to true if you want to prevent the stroke from being erased. You can use this technique when the EditingMode or EditingModeInverted property is set to EraseByStroke or EraseByPoint.

The following example prevents any strokes rendered as highlighters from being erased. The example assumes that the InkCanvas is connected to the event handler.

void inkCanvas1_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e)
{
    if (e.Stroke.DrawingAttributes.IsHighlighter)
    {
        e.Cancel = true;
    }
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2014 Microsoft