Strokes.Contains Method
Strokes.Contains Method |
Indicates whether the Strokes collection contains a specific Stroke object.
Definition
Visual Basic .NET Public Function Contains( _
ByVal s As Stroke _
) As BooleanC# public bool Contains(
Stroke s
);Managed C++ public: bool* Contains(
Stroke *s
);
Parameters
s Microsoft.Ink.Stroke. The Stroke object to check for.
Return Value
System.Boolean. Whether the Strokes collection contains a specific Stroke object.
true
The Strokes collection contains the specific Stroke object. false
The Strokes collection does not contain the specific Stroke object.
Remarks
The behavior of this method is undefined if the parent Ink object for the Strokes collection is different than the parent Ink object for the Stroke object.
Examples
[C#]
This C# example checks to see if a stored Stroke object, specialStroke, is member of an InkOverlay object's Strokes collection. If theSpecialStroke is is member of the Strokes collection, the example sets the color of the Stroke to red.
if (theInkOverlay.Ink.Strokes.Contains(specialStroke)) { specialStroke.DrawingAttributes.Color = Color.Red; }
[VB.NET]
This Microsoft® Visual Basic® .NET example checks to see if a stored Stroke object, specialStroke, is member of an InkOverlay object's Strokes collection. If theSpecialStroke is is member of the Strokes collection, the example sets the color of the Stroke to red.
If theInkOverlay.Ink.Strokes.Contains(specialStroke) Then specialStroke.DrawingAttributes.Color = Color.Red End If
See Also