Strokes コレクションに、特定の Stroke オブジェクトが格納されているかどうかを示します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public Function Contains ( _
s As Stroke _
) As Boolean
'使用
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
パラメータ
- s
型 : Microsoft.Ink.Stroke
戻り値
型 : System.Boolean
Strokes コレクションに特定の Stroke オブジェクトが格納されているかどうかを示します。
値 |
説明 |
---|---|
true |
|
false |
解説
Strokes コレクションの親 Ink オブジェクトが Stroke オブジェクトの親 Ink オブジェクトと異なる場合、このメソッドの動作は未定義です。
例
この例では、Contains メソッドを使用して、特定の Stroke オブジェクトが Strokes コレクションのメンバであるかどうかを判断します。メンバである場合、Stroke の色は赤に設定されます。
' 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;
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0