wpf Label Code Example🎞️⌨️💡

A XAML Label element represents a Label control. Code sample of how to use a XAML Label.
The code example in Listing 1 creates a Label control in XAML and sets the name, height, width and content of a Label control. The code also sets the font format for the text.
Figure 1

The Background and Foreground properties set the background and foreground colors of the Label control. The code snippet in Listing 2 sets the background, foreground and alignment of a Label control.

Up Next
    Ebook Download
    View all
    Learn
    View all