共用方式為


Strokes.StrokesRemoved Event

Strokes.StrokesRemoved Event

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

Definition

Visual Basic .NET Public Event StrokesRemoved As StrokesEventHandler
C# public event StrokesEventHandler StrokesRemoved;
Managed C++ public: __event StrokesEventHandler StrokesRemoved;

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 will handle 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.

Examples

[C#]

This C# example demonstrates adding a StrokesRemoved event handler to a Strokes collection object. The event handler writes information about the removed strokes to a list box, listBox1.

//...

// 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;
    listBox1.Items.Clear();
    foreach (int i in theRemovedStrokesIDs)
    {
        listBox1.Items.Add("Removed Stroke ID: " + i.ToString());
    }
}

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example demonstrates adding a StrokesRemoved event handler to a Strokes collection object. The event handler writes information about the removed strokes to a list box, ListBox1.

'...

'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
    ListBox1.Items.Clear()
    Dim i As Integer
    For Each i In theRemovedStrokesIDs
        ListBox1.Items.Add("Removed Stroke ID: " & i.ToString())
    Next
End Sub

See Also