StrokeCollection.Add Method (StrokeCollection)

Adds the specified strokes to the StrokeCollection.

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public void Add(
	StrokeCollection strokes


Type: System.Windows.Ink.StrokeCollection

The StrokeCollection to add to the collection.


A Stroke in strokes is already a member of the StrokeCollection.


strokes is null.

The Add method raises the StrokesChanged event.

The following example demonstrates how to copy the ink in one InkCanvas onto another InkCanvas. This example assumes:

  • There are two InkCanvas objects called inkCanvas1 and inkCanvas2.

  • The Click event has been connected to the event handler.

// Copy the strokes from one InkCanvas to another InkCanvas. 
private void CopyStrokes_Click(object sender, RoutedEventArgs e) 
    StrokeCollection strokes = inkCanvas1.Strokes.Clone();


.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft