Sdílet prostřednictvím


CustomStrokes.RemoveAt Method

Removes a Strokes collection at the specified index of the CustomStrokes collection.

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

Syntax

'Declaration
Public Sub RemoveAt ( _
    i As Integer _
)
'Usage
Dim instance As CustomStrokes 
Dim i As Integer

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

Parameters

Remarks

A CustomStrokes collection is a reference to ink data and is not the actual data itself. This method removes only the related collection from a snapshot of, or reference to, the ink data and does not remove the actual ink data. To delete the collection from the actual ink data, call the Ink.DeleteStrokes method.

A System.ArgumentOutOfRangeException is raised if the index does not match an existing member of the CustomStrokes collection. If for development purposes you are using Windows XP (not the Tablet Edition) with the Tablet PC SDK installed and the index does not match an existing member of the CustomStrokes collection, a System.Runtime.InteropServices.COMException is raised.

Examples

In this example, the Strokes collection that exists at the specified index of a CustomStrokes collection is removed. If a Strokes collection does not exist at the specified index, an exception is raised.

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
    }

}

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

CustomStrokes Class

CustomStrokes Members

Microsoft.Ink Namespace