Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Line.X1 Property


Gets or sets the x-coordinate of the Linestart point.

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

public double X1 { get; set; }

Property Value

Type: System.Double

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

Legacy Code Example

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

// Add a Line Element
myLine = gcnew 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;
Code snippet is not found. Confirm that the code snippet name 'HOWDOI' is correct.Code snippet is not found. Confirm that the code snippet name 'HOWDOI' is correct.

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