共用方式為


StrokeCollection.Add(StrokeCollection) 方法

定義

將指定的筆劃加入至 StrokeCollection

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

參數

strokes
StrokeCollection

要加入至集合的 StrokeCollection

例外狀況

strokes 中的 Stroke 已經是 StrokeCollection 的成員。

strokesnull

範例

下列範例示範如何將一個中的筆跡複製到另一 InkCanvasInkCanvas 。 此範例假設:

  • 有兩 InkCanvas 個物件稱為 inkCanvas1inkCanvas2

  • 事件 Click 已連線到事件處理常式。

// Copy the strokes from one InkCanvas to another InkCanvas.
private void CopyStrokes_Click(object sender, RoutedEventArgs e) 
{
    StrokeCollection strokes = inkCanvas1.Strokes.Clone();
    inkCanvas2.Strokes.Clear();
    inkCanvas2.Strokes.Add(strokes);
}
' Copy the strokes from one InkCanvas to another InkCanvas.
Private Sub CopyStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

    Dim strokes As StrokeCollection = inkCanvas1.Strokes.Clone()
    inkCanvas2.Strokes.Clear()
    inkCanvas2.Strokes.Add(strokes)

End Sub

備註

Add 方法會引發 StrokesChanged 事件。

適用於