共用方式為


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 PC SDK 的 Windows XP (非 Tablet Edition),而且 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 命名空間