StylusPointCollection.Add(StylusPointCollection) Method

Definition

Adds the specified StylusPointCollection to the current StylusPointCollection.

C#
public void Add(System.Windows.Input.StylusPointCollection stylusPoints);

Parameters

stylusPoints
StylusPointCollection

The StylusPointCollection to add to the current StylusPointCollection.

Exceptions

stylusPoints is null.

The StylusPointDescription of stylusPoints is not compatible with the Description property.

Examples

The following example collects StylusPoint objects in the OnStylusDown method of a custom control.

C#
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);
}

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10