How to create a Label in WPF?

The Label element in XAML represents a WPF Label control.

<Label />


The following code snippet creates a Label control and sets its width, height, background color, foreground color and font properties.

<Label Name="McLabel" Width="240" Height="30"

       Background="LightGray" Foreground="DarkBlue"

       FontFamily="Verdana" FontSize="14" FontWeight="Bold">

    I am a label control

</Label>