Share via


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 引發 事件。

適用於