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

注解

方法RemoveStrokesChanged针对它删除的每个Stroke引发 事件。

适用于