InkOverlay.StrokesDeleted Event
Assembly: Microsoft.Ink (in microsoft.ink.dll)
'Declaration Public Event StrokesDeleted As InkOverlayStrokesDeletedEventHandler 'Usage Dim instance As InkOverlay Dim handler As InkOverlayStrokesDeletedEventHandler AddHandler instance.StrokesDeleted, handler
/** @event */ public void add_StrokesDeleted (InkOverlayStrokesDeletedEventHandler value) /** @event */ public void remove_StrokesDeleted (InkOverlayStrokesDeletedEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.
This event fires when you call either the Ink.DeleteStroke or the Microsoft.Ink.Ink.DeleteStrokes method for ink attached to an InkOverlay object.
The event handler receives an argument of type EventArgsEventArgs, which contains no data.
This C# example changes a control's background color to white when there are Stroke objects in the InkOverlay object, theInkOverlay. If there are no Stroke objects in theInkOverlay, the example changes the background color to gray. Note that when deleting strokes with an eraser, the movement of the eraser is considered a Stroke object.
using Microsoft.Ink; //... theInkOverlay.Stroke += new InkCollectorStrokeEventHandler(theInkOverlay_Stroke); theInkOverlay.StrokesDeleted += new InkOverlayStrokesDeletedEventHandler(theInkOverlay_StrokesDeleted); //... private void theInkOverlay_Stroke(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 (theInkOverlay.EditingMode == InkOverlayEditingMode.Ink) { BackColor = Color.White; } } private void theInkOverlay_StrokesDeleted(object sender, System.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 (theInkOverlay.Ink.Strokes.Count == 0 || (theInkOverlay.Ink.Strokes.Count == 1 && theInkOverlay.Ink.Strokes[0].DrawingAttributes.Transparency == 255)) { BackColor = Color.Gray; } } //...
This Microsoft Visual Basic .NET example changes a control's background color to white when there are Stroke objects in the InkOverlay object, theInkOverlay. If there are no Stroke objects in theInkOverlay, the example changes the background color to gray. Note that when deleting strokes with an eraser, the movement of the eraser is considered an Stroke object.
Imports Microsoft.Ink '... Private WithEvents theInkOverlay As InkOverlay '... Private Sub theInkOverlay_Stroke(ByVal sender As Object, ByVal e As Microsoft.Ink.InkCollectorStrokeEventArgs) _ Handles theInkOverlay.Stroke '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 theInkOverlay.EditingMode = InkOverlayEditingMode.Ink Then BackColor = Color.White End If End Sub Private Sub theInkOverlay_StrokesDeleted(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles theInkOverlay.StrokesDeleted '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 theInkOverlay.Ink.Strokes.Count = 0 Or _ (theInkOverlay.Ink.Strokes.Count = 1 And _ theInkOverlay.Ink.Strokes(0).DrawingAttributes.Transparency = 255) Then BackColor = Color.Gray End If End Sub
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.