Export (0) Print
Expand All

TableCell.BorderBrush Property

Gets or sets a Brush to use when painting the element's border.

Namespace: System.Windows.Documents
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 used to apply to the element's border. The default value is a null brush.

For a table of swatches that show the available pre-defined brush colors, see Brushes.

The following example shows how to set the BorderBrush attribute of a Block element (Paragraph).

<FlowDocument>
  <Paragraph Name="par"
    BorderBrush="Blue"
    BorderThickness="0.25in"
  >
    <Run>
      Child elements in this Block element (Paragraph) will be surrounded by a blue border.
    </Run>
    <LineBreak/><LineBreak/>
    <Run>
      This border will be one quarter inch thick in all directions.
    </Run>
  </Paragraph>
</FlowDocument>

The following figure shows how this example renders.

Screenshot: Blue, 1/4inch border around Block

The following example shows how to set the BorderBrush property programmatically.

Paragraph par = new Paragraph();

Run run1 = new Run("Child elements in this Block element (Paragraph) will be surrounded by a blue border.");
Run run2 = new Run("This border will be one quarter inch thick in all directions.");

par.Inlines.Add(run1);
par.Inlines.Add(run2);

par.BorderBrush = Brushes.Blue;
ThicknessConverter tc = new ThicknessConverter();
par.BorderThickness = (Thickness)tc.ConvertFromString("0.25in");

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:
© 2014 Microsoft