Perform the following simple steps to add a border around TextBlock:
- Open the MainWindow.xaml file of your WPF project.
- Now replace the default Grid with a StackPanel.
- Add a few TextBlocks inside it, wrapped by a Border. Here's the complete XAML code:
<StackPanel Margin="10"> <Border BorderBrush="OrangeRed" BorderThickness="2" Margin="10 4" Padding="10"> <TextBlock Text="Text surrounded by border"/> </Border> <Border BorderBrush="OrangeRed" BorderThickness="2" CornerRadius="20" Margin="10 4" Padding="10"> <TextBlock Text="Text surrounded by border,
having corner radius = 20"/> </Border> <Border BorderBrush="OrangeRed" BorderThickness="2" CornerRadius...