Export (0) Print
Expand All

StrokeCollection.Remove Method (StrokeCollection)

Removes the specified strokes from the collection.

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

public void Remove(
	StrokeCollection strokes
)

The Remove method raises the StrokesChanged event for each Stroke it removes.

The following example demonstrates how to remove all strokes that are at least 80 percent within the specified lasso from a StrokeCollection. This is useful when a custom control enables the user to select ink with a lasso. To create a control that enables a user to select ink with a lasso, see How to: Select Ink from a Custom Control.

// Remove the strokes within the lasso from the InkPresenter 
public void RemoveStrokes(Point[] lasso)
{
    StrokeCollection strokes = presenter.Strokes.HitTest(lasso, 80);

    presenter.Strokes.Remove(strokes);

}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft