Freigeben über


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 boolean Contains (
    Stroke s
)
public function Contains (
    s : Stroke
) : boolean
Not applicable.

Parameters

  • s

Return Value

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.

Example

This C# example checks to see if a stored Stroke object, specialStroke, is member of an InkOverlay object's Strokes collection. If theSpecialStroke is a 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;
}

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 a 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

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Strokes Class
Strokes Members
Microsoft.Ink Namespace
Stroke