Strokes.StrokesAdded-Ereignis
.NET Framework 3.0
Occurs when one or more Stroke objects are added to the Strokes collection.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)
Assembly: Microsoft.Ink (in microsoft.ink.dll)
The event handler receives an argument of type StrokesEventArgs containing data about this event.
When you create a StrokesEventHandler delegate, you identify the method handling 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.
This C# example adds an StrokesAdded event handler to a Strokes collection object. The event handler writes information about the added strokes to a list box, theListBox.
//... // Add a handler for StrokesAdded Events so we can display // their IDs in a listbox. theStrokes.StrokesAdded += new StrokesEventHandler(StrokesAdded_Event); //... public void StrokesAdded_Event(object sender, StrokesEventArgs e) { int [] theAddedStrokesIDs = e.StrokeIds; theListBox.Items.Clear(); foreach (int i in theAddedStrokesIDs) { theListBox.Items.Add("Added Stroke ID: " + i.ToString()); } }
This Microsoft Visual Basic.NET example adds an StrokesAdded event handler to a Strokes collection object. The event handler writes information about the added strokes to a list box, theListBox.
'... 'Add a handler for StrokesAdded events so we can display 'their IDs in a listbox. AddHandler theStrokes.StrokesAdded, AddressOf StrokesAdded_Event '... Public Sub StrokesAdded_Event(ByVal sender as Object, _ ByVal e As StrokesEventArgs) Dim theAddedStrokesIDs() As Integer = e.StrokeIds theListBox.Items.Clear() Dim i As Integer For Each i In theAddedStrokesIDs theListBox.Items.Add("Added Stroke ID: " & i.ToString()) Next End Sub