Search This Blog

Wednesday, July 22, 2015

Add a Border to a TextBlock WPF

WPF > Windows > Controls > Border

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

Example: Add a Border to a TextBlock

<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left"                     VerticalAlignment="Top">
            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap"  Text="TextBlock"  VerticalAlignment="Top"/>
 </Border>