Add Border to TextBlock

image_pdfimage_print


   
     

<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF" Height="160" Width="300">
    <Grid>
        <Border Margin="8" 
                BorderThickness="1"
                BorderBrush="Black"
                Width="160" 
                Height="60">
            <TextBlock Foreground="DarkGray" 
                       VerticalAlignment="Center" 
                       HorizontalAlignment="Center"
                       ToolTip="This is a custom tooltip"
                       Text="Mouse Over for tooltip"/>
        </Border>
    </Grid>
    
</Window>