Line.X2 Eigenschaft

Definition

Ruft die x-Koordinate des Line-Endpunkts ab oder legt diese fest.

public:
 property double X2 { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
public double X2 { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))>]
member this.X2 : double with get, set
Public Property X2 As Double

Eigenschaftswert

Die x-Koordinate des Endpunkts der Linie. Der Standardwert ist 0.

Attribute

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie eine Line erstellen und dann die X2 -Eigenschaft mithilfe von Code festlegen.


// 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;
myGrid->Children->Add(myLine);

// Add a Line Element
myLine = new Line();
myLine.Stroke = System.Windows.Media.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);

' 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)

Hinweise

Informationen zur Abhängigkeitseigenschaft

Bezeichnerfeld X2Property
Metadateneigenschaften auf true festgelegt AffectsMeasure, AffectsRender

Gilt für: