Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

Line-Klasse

Draws a straight line between two points. This class cannot be inherited.

Namespace: System.Windows.Shapes
Assembly: PresentationFramework (in presentationframework.dll)
XML-Namespaces:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public sealed class Line : Shape
public final class Line extends Shape
public final class Line extends Shape

The following example shows how to create a Line element and set its properties by using code. For the complete sample, see Create Shape Elements Using Code Sample.


// Add a Line Element
myLine = 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);

Weiterer Code

How to: Draw a Line

This example shows you how to draw lines by using the Line element.

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Media.Visual
         System.Windows.UIElement
           System.Windows.FrameworkElement
             System.Windows.Shapes.Shape
              System.Windows.Shapes.Line

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0
Anzeigen: