Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

StrokesEventHandler Delegate

Represents the method that handles events for adding and removing Strokes on the Ink object, InkOverlay object, InkPicture control, and Strokes collection.

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

public delegate void StrokesEventHandler(
	Object sender,
	StrokesEventArgs e
)

Parameters

sender
Type: System.Object

The source Ink object or Strokes collection of this event.

e
Type: Microsoft.Ink.StrokesEventArgs

The StrokesEventArgs object that contains the event data.

When you create a StrokesEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

The StrokesEventHandler delegate is used to implement the InkAdded, InkDeleted, StrokesAdded, and StrokesRemoved event handlers.

In this example, an InkAdded event handler writes information about the added strokes to a list box control.

private void Ink_InkAdded(object sender, StrokesEventArgs e)
{
    // since this event fires in all modes, we will check EditingMode 
    // and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Ink  
    if (InkOverlayEditingMode.Ink == this.mInkOverlay.EditingMode)
    {
        foreach (int id in e.StrokeIds)
        {
            this.listBoxStrokeId.Items.Add("Added ID:" + id.ToString());

        }
    }
}

In this example an InkDeleted event handler writes information about the deleted strokes to a list box control.

private void Ink_InkDeleted(object sender, StrokesEventArgs e)
{
    // since this event fires in select mode also, we will check EditingMode 
    // and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete  
    if (InkOverlayEditingMode.Delete == this.mInkOverlay.EditingMode)
    {
        foreach (int id in e.StrokeIds)
        {
            this.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString());

        }
    }
}

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

Community Additions

ADD
Show:
© 2015 Microsoft