This documentation is archived and is not being maintained.
Polyline Class
Visual Studio 2008
Draws a series of connected straight lines.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
This object is similar to the Polygon object, except that this object does not need to be a closed shape.
The following example shows how to create a Polyline element and set its properties by using code. For the complete sample, see WPF Shapes Gallery Sample.
' Add a Polyline Element Dim myPolyline As New Polyline() myPolyline.Stroke = Brushes.SlateGray myPolyline.StrokeThickness = 2 myPolyline.FillRule = FillRule.EvenOdd Dim Point4 As New System.Windows.Point(1, 50) Dim Point5 As New System.Windows.Point(10, 80) Dim Point6 As New System.Windows.Point(20, 40) Dim myPointCollection2 As New PointCollection() myPointCollection2.Add(Point4) myPointCollection2.Add(Point5) myPointCollection2.Add(Point6) myPolyline.Points = myPointCollection2 myGrid.Children.Add(myPolyline)
More Code
| How to: Draw a Polyline by Using the Polyline Element | This example shows how to draw a polyline, which is a series of connected lines, by using the Polyline element. |
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: