次の方法で共有


CustomStrokes.RemoveAt メソッド

CustomStrokes コレクションの指定したインデックス位置にある Strokes コレクションを削除します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public Sub RemoveAt ( _
    i As Integer _
)
'使用
Dim instance As CustomStrokes
Dim i As Integer

instance.RemoveAt(i)
public void RemoveAt(
    int i
)
public:
void RemoveAt(
    int i
)
public void RemoveAt(
    int i
)
public function RemoveAt(
    i : int
)

パラメータ

解説

CustomStrokes コレクションはインク データへの参照であり、実際のデータ自体ではありません。このメソッドは、インク データのスナップショットまたはインク データへの参照からのみ関連するコレクションを削除し、実際のインク データは削除しません。実際のインク データからコレクションを削除するには、Ink.DeleteStrokes メソッドを呼び出します。

index が CustomStrokes コレクションの既存のメンバと一致しない場合は System.ArgumentOutOfRangeException が発生します。開発目的で、Tablet Edition ではなく、Tablet PC SDK がインストールされている Windows XP を使用していて、index が CustomStrokes コレクションの既存のメンバと一致しない場合は System.Runtime.InteropServices が発生します。

この例では、CustomStrokes コレクションの指定されたインデックスに存在する Strokes コレクションが削除されます。Strokes コレクションが指定されたインデックスに存在しない場合は、例外が発生します。

Private Sub RemoveCustomStrokes(ByVal mIndex As Integer, ByVal mInk As Ink)
    Try
        ' if the indexed position does not exist, an exception will be raised
        mInk.CustomStrokes.RemoveAt(mIndex)

    Catch E As System.Runtime.InteropServices.COMException
        ' For Windows XP (not Tablet Edition) with Tablet PC SDK installed for development purposes
        ' this exception is raised when the indexed collection does not exist

    Catch E As ArgumentOutOfRangeException
        ' For Windows XP Tablet Edition and Vista
        ' this exception is raised when the indexed collection does not exist
    End Try
End Sub
private void RemoveCustomStrokes(int mIndex, Ink mInk)
{
    try
    {
        // if the indexed position does not exist, an exception will be raised
        mInk.CustomStrokes.RemoveAt(mIndex);
    }
    catch (System.Runtime.InteropServices.COMException)
    {
        // For Windows XP (not Tablet Edition) with Tablet PC SDK installed for development purposes
        // this exception is raised when the indexed collection does not exist
    }
    catch (ArgumentOutOfRangeException)
    {
        // For Windows XP Tablet Edition and Vista
        // this exception is raised when the indexed collection does not exist
    }

}

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

CustomStrokes クラス

CustomStrokes メンバ

Microsoft.Ink 名前空間