AnchoredBlock.BorderBrush Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a Brush to use when painting the element's border.
public:
property System::Windows::Media::Brush ^ BorderBrush { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush BorderBrush { get; set; }
member this.BorderBrush : System.Windows.Media.Brush with get, set
Public Property BorderBrush As Brush
The brush used to apply to the element's border. The default value is a null
brush.
The following example shows how to set the BorderBrush attribute of an 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.
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");
Dim par As New Paragraph()
Dim run1 As New Run("Child elements in this Block element (Paragraph) will be surrounded by a blue border.")
Dim run2 As 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
Dim tc As New ThicknessConverter()
par.BorderThickness = CType(tc.ConvertFromString("0.25in"), Thickness)
For a table of swatches that show the available pre-defined brush colors, see Brushes.
Item | Value |
---|---|
Identifier field | BorderBrushProperty |
Metadata properties set to true |
AffectsRender |
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: