语言

StrokeCollection.Remove(StrokeCollection) 方法

定义

从集合中删除指定的笔划。

public:
 void Remove(System::Windows::Ink::StrokeCollection ^ strokes);
public void Remove(System.Windows.Ink.StrokeCollection strokes);
override this.Remove : System.Windows.Ink.StrokeCollection -> unit
Public Sub Remove (strokes As StrokeCollection)

参数

strokes
StrokeCollection

要 StrokeCollection 从集合中移除的集合。

示例

下面的示例演示如何从指定 StrokeCollection套索中删除至少为 80% 的所有笔划。 当自定义控件允许用户使用套索选择墨迹时,这非常有用。 若要创建允许用户使用套索选择墨迹的控件,请参阅 “如何:从自定义控件中选择墨迹”。

// Remove the strokes within the lasso from the InkPresenter
public void RemoveStrokes(Point[] lasso)
{
    StrokeCollection strokes = presenter.Strokes.HitTest(lasso, 80);

    presenter.Strokes.Remove(strokes);
}
' Remove the strokes within the lasso from the InkPresenter
Public Sub RemoveStrokes(ByVal lasso As Point())

    If lasso Is Nothing Then
        Return
    End If

    Dim strokes As StrokeCollection = _
        presenter.Strokes.HitTest(lasso, 80)

    presenter.Strokes.Remove(strokes)

End Sub

注解

该方法Remove会为其删除的每个StrokesChanged事件引发Stroke事件。

适用于