Freigeben über


Strokes.StrokesRemoved Event

Occurs when one or more Stroke objects are deleted from the Strokes collection.

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

Syntax

'Declaration
Public Event StrokesRemoved As StrokesEventHandler
'Usage
Dim instance As Strokes
Dim handler As StrokesEventHandler

AddHandler instance.StrokesRemoved, handler
public event StrokesEventHandler StrokesRemoved
public:
event StrokesEventHandler^ StrokesRemoved {
    void add (StrokesEventHandler^ value);
    void remove (StrokesEventHandler^ value);
}
/** @event */
public void add_StrokesRemoved (StrokesEventHandler value)

/** @event */
public void remove_StrokesRemoved (StrokesEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

Remarks

The event handler receives an argument of type StrokesEventArgs containing data about this event.

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.

Example

This C# example adds a StrokesRemoved event handler to a Strokes object, theStrokes. The event handler writes information about the removed strokes to a list box, theListBox.

//...

// Add a handler for InkDeleted Events so we can display
// their IDs in a listbox.
theStrokes.StrokesRemoved += new StrokesEventHandler(StrokesRemoved_Event);

//...

public void StrokesRemoved_Event(object sender, StrokesEventArgs e)
{
    int [] theRemovedStrokesIDs = e.StrokeIds;
    theListBox.Items.Clear();
    foreach (int i in theRemovedStrokesIDs)
    {
        theListBox.Items.Add("Removed Stroke ID: " + i.ToString());
    }
}

This Microsoft Visual Basic.NET example adds an StrokesRemoved event handler to a Strokes object, theStrokes. The event handler writes information about the removed strokes to a list box, theListBox.

'...

'Add a handler for StrokesRemoved events so we can display
'their IDs in a listbox.
AddHandler theStrokes.StrokesRemoved, AddressOf StrokesRemoved_Event

'...

Public Sub StrokesRemoved_Event(ByVal sender as Object, _
    ByVal e As StrokesEventArgs)
    Dim theRemovedStrokesIDs() As Integer = e.StrokeIds
    theListBox.Items.Clear()
    Dim i As Integer
    For Each i In theRemovedStrokesIDs
        theListBox.Items.Add("Removed Stroke ID: " & i.ToString())
    Next
End Sub

Platforms

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.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Strokes Class
Strokes Members
Microsoft.Ink Namespace
Ink
Microsoft.Ink.Strokes.Remove