共用方式為


StylusPointCollection.Add(StylusPointCollection) 方法

定義

將指定的 StylusPointCollection 加入至目前的 StylusPointCollection

public:
 void Add(System::Windows::Input::StylusPointCollection ^ stylusPoints);
public void Add (System.Windows.Input.StylusPointCollection stylusPoints);
override this.Add : System.Windows.Input.StylusPointCollection -> unit
Public Sub Add (stylusPoints As StylusPointCollection)

參數

例外狀況

stylusPointsnull

stylusPointsStylusPointDescriptionDescription 屬性不相容。

範例

下列範例會在 StylusPoint 自定義控件的方法中 OnStylusDown 收集 物件。

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);
}
Private stylusPoints As StylusPointCollection


Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs) 
    MyBase.OnStylusDown(e)
    
    Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
    
    ' Create a new StylusPointCollection using the StylusPointDescription
    ' from the stylus points in the StylusDownEventArgs.
    stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
    stylusPoints.Add(eventPoints)

End Sub

適用於