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

Border-Klasse

Draws a border, background, or both around another element.

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

public class Border : Decorator
public class Border extends Decorator
public class Border extends Decorator

Content Model: Border can have only one child. To display multiple child elements, you need to place an additional Panel element within the parent Border. You can then place child elements within that Panel element.

If you want to display a border around your content, you must place the elements within a parent Border element.

The following example demonstrates how to create a Border and set properties in code and.

myBorder = new Border();
myBorder.Background = Brushes.LightBlue;
myBorder.BorderBrush = Brushes.Black;
myBorder.BorderThickness = new Thickness(2);
myBorder.CornerRadius = new CornerRadius(45);
myBorder.Padding = new Thickness(25);

<Border Background="LightBlue" 
        BorderBrush="Black" 
        BorderThickness="2" 
        CornerRadius="45" 
        Padding="25">

Weiterer Code

How to: Wrap a Border Around the Content of a Canvas

This example shows how to wrap a Canvas element with a Border.

How to: Change Border Properties

This example shows how to change the Background color of a Border element.

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Media.Visual
         System.Windows.UIElement
           System.Windows.FrameworkElement
             System.Windows.Controls.Decorator
              System.Windows.Controls.Border

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: