X2 Property
Collapse the table of content
Expand the table of content

Line.X2 Property

 

Gets or sets the x-coordinate of the Line end point.

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

<TypeConverterAttribute(GetType(LengthConverter))>
Public Property X2 As Double

Property Value

Type: System.Double

The x-coordinate for the end point of the line. The default is 0.

The following example shows how to create a Line and then set the X2 property by using code.


' Add a Line Element
Dim myLine As New Line()
myLine.Stroke = Brushes.LightSteelBlue
myLine.X1 = 1
myLine.X2 = 50
myLine.Y1 = 1
myLine.Y2 = 50
myLine.HorizontalAlignment = HorizontalAlignment.Left
myLine.VerticalAlignment = VerticalAlignment.Center
myLine.StrokeThickness = 2
myGrid.Children.Add(myLine)

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft