Share via


Strokes.Contains Method

Indicates whether the Strokes collection contains a specific Stroke object.

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

Syntax

'Declaration
Public Function Contains ( _
    s As Stroke _
) As Boolean
'Usage
Dim instance As Strokes 
Dim s As Stroke 
Dim returnValue As Boolean 

returnValue = instance.Contains(s)
public bool Contains(
    Stroke s
)
public:
bool Contains(
    Stroke^ s
)
public function Contains(
    s : Stroke
) : boolean

Parameters

Return Value

Type: System.Boolean
Whether the Strokes collection contains a specific Stroke object.

Value

Meaning

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

In this example, the Contains method is used to determine if a particular Stroke object is a member of the Strokes collection. If so, the color of the Stroke is set to red.

' Access to the Strokes property returns a copy of the Strokes object. 
' This copy must be implicitly (via using statement) or explicitly 
' disposed of in order to avoid a memory leak. 
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes
    If allStrokes.Contains(specialStroke) Then
        specialStroke.DrawingAttributes.Color = Color.Red
    End If 
End Using
// Access to the Strokes property returns a copy of the Strokes object. 
// This copy must be implicitly (via using statement) or explicitly 
// disposed of in order to avoid a memory leak. 
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
    if (allStrokes.Contains(specialStroke))
    {
        specialStroke.DrawingAttributes.Color = Color.Red;
    }
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

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

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Strokes Class

Strokes Members

Microsoft.Ink Namespace

Stroke