Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

Strokes.StrokesAdded-Ereignis

Occurs when one or more Stroke objects are added to the Strokes collection.

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

public event StrokesEventHandler StrokesAdded
/** @event */
public void add_StrokesAdded (StrokesEventHandler value)

/** @event */
public void remove_StrokesAdded (StrokesEventHandler value)

In JScript können Sie die durch eine Klasse definierten Ereignisse verwenden, jedoch keine eigenen definieren.
Nicht zutreffend.

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

Windows XP Media Center Edition

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0
Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
© 2013 Microsoft. Alle Rechte vorbehalten.