Partager via


Ink.DeleteStrokes Method

Ink.DeleteStrokes Method

Deletes all of the Stroke objects in the Ink object.

Definition

Visual Basic .NET Public Sub DeleteStrokes()
C# public void DeleteStrokes();
Managed C++ public: void DeleteStrokes();

Exceptions

ObjectDisposedException Leave Site: The Ink object is disposed.

Remarks

The DeleteStrokes method can result in an error if called while the user is actively laying down ink.

Note: A Strokes collection that points to an Ink.Strokes property become invalid when Stroke objects that are contained in the original collection are deleted from the Ink object. For example, if there is a named Strokes collection, theStrokesToo, that is based on an Ink object's Strokes property, theStrokes, and you call the DeleteStrokes method on theStrokes, then theStrokesToo becomes invalid.

To delete only one Stroke object at a time, call the DeleteStroke method.

Examples

[C#]

This C# example function deletes all of the Stroke objects in the Ink object and redraws the panel, thePanel, to which the InkCollector object, theInkCollector, is attached.

theInkCollector.Ink.DeleteStrokes();
thePanel.Refresh();

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example function deletes all of the Stroke objects in the Ink object and redraws the panel, thePanel, to which the InkCollector object, theInkCollector, is attached.

theInkCollector.Ink.DeleteStrokes()
thePanel.Refresh()

See Also