Draws a border, background, or both around another element.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Content Model: can have only one child. To display multiple child elements, you need to place an additional Panel element within the parent . 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 element.
The following example demonstrates how to create a and set properties in code and Extensible Application Markup Language (XAML).
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);
|How to: Wrap a Border Around the Content of a Canvas||This example shows how to wrap a Canvas element with a .|
|How to: Change Border Properties||This example shows how to change the Background color of a element.|
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.