Export (0) Print
Expand All

Border.BorderBrush Property

Gets or sets the Brush that draws the outer border color.

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

public Brush BorderBrush { get; set; }
/** @property */
public Brush get_BorderBrush ()

/** @property */
public void set_BorderBrush (Brush value)

public function get BorderBrush () : Brush

public function set BorderBrush (value : Brush)

For XAML information, see the Brush type.

Property Value

The Brush that draws the outer border color. This property has no default value.

The following example shows how to set the value of the BorderBrush property by using Extensible Application Markup Language (XAML) and code.

myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
myBorder1.BorderThickness = new Thickness(5, 10, 15, 20);
myBorder1.Background = Brushes.AliceBlue;
myBorder1.Padding = new Thickness(5);
myBorder1.CornerRadius = new CornerRadius(15);

<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

More 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: Paint an Area with an Image

This example shows how to use the ImageBrush class to paint an area by using an image. An ImageBrush displays a single image, which is specified by its ImageSource property.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft