Polygon::Points Property


Gets or sets a collection that contains the vertex points of the polygon.

Namespace:   System.Windows.Shapes
Assembly:  PresentationFramework (in PresentationFramework.dll)

property PointCollection^ Points {
	PointCollection^ get();
	void set(PointCollection^ value);

Property Value

Type: System.Windows.Media::PointCollection^

A collection of Point structures that describe the vertex points of the polygon. The default is a null reference (Nothing in Visual Basic).

In Extensible Application Markup Language (XAML), use a space-delimited list of comma-separated x-coordinate and y-coordinate pairs to set this attribute. Use simple notation, that is, x1,y1 x2,y2 ... xn,yn.

Identifier field


Metadata properties set to true

AffectsRender, AffectsMeasure

The following example shows how to create a Polygon element and set the Points property by using code.

//Add the Polygon Element
myPolygon = gcnew Polygon();
myPolygon->Stroke = Brushes::Black;
myPolygon->Fill = Brushes::LightSeaGreen;
myPolygon->StrokeThickness = 2;
myPolygon->HorizontalAlignment = HorizontalAlignment::Left;
myPolygon->VerticalAlignment = VerticalAlignment::Center;
Point Point1 = Point(1, 50);
Point Point2 = Point(10, 80);
Point Point3 = Point(50, 50);
PointCollection^ myPointCollection = gcnew PointCollection();
myPolygon->Points = myPointCollection;

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top