共用方式為


CustomStrokes.Remove 方法

CustomStrokes 集合移除 Strokes 集合。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public Sub Remove ( _
    s As String _
)
'用途
Dim instance As CustomStrokes
Dim s As String

instance.Remove(s)
public void Remove(
    string s
)
public:
void Remove(
    String^ s
)
public void Remove(
    String s
)
public function Remove(
    s : String
)

參數

備註

當呼叫這個方法時,會移除以 s 參數加入的相同 Strokes 集合。

CustomStrokes 集合是筆墨資料的一組參考,並非實際資料本身。這個方法只會從實際筆墨資料的快照或參考移除 Strokes 集合,並不會從實際筆墨資料移除 Strokes 集合。若要從實際筆墨資料刪除集合,請呼叫 Ink.DeleteStrokes 方法。

如果 name 與 CustomStrokes 集合的現有成員不相符,則會引發 System.ArgumentException (英文)。

範例

在這個範例中,會移除 CustomStrokes 集合內與指定的名稱同名的 Strokes 集合。如果 Strokes 集合沒有與指定的名稱同名,則會引發例外狀況。

Private Sub RemoveCustomStrokes(ByVal mName As String, ByVal mInk As Ink)
    Try
        ' if the name does not exist, an exception will be raised
        mInk.CustomStrokes.Remove(mName)
    Catch E As ArgumentException
        ' this exception is raised when the named collection does not exist
    End Try

End Sub
private void RemoveCustomStrokes(string mName, Ink mInk)
{
    try
    {
        // if the name does not exist, an exception will be raised
        mInk.CustomStrokes.Remove(mName);
    }
    catch (ArgumentException)
    {
        // this exception is raised when the named collection does not exist
    }

}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

CustomStrokes 類別

CustomStrokes 成員

Microsoft.Ink 命名空間

Ink.DeleteStrokes

Ink