XAML Label

This article shows how to create and use a Label control in XAML.
  • 2954

<Label /> element represents a Label control in XAML.

Creating a Label

The following code creates a Label control.

<Window xmlns="http://schemas.microsoft.com/winfx/avalon/2005"

xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005">

    <Label>This is Label</Label>
</Window>

Setting Label Properties

The following code sets height, width, background color, foreground color, font size and font name of the Label control.

<Label Height="50" Width="200" Background="lightblue" Foreground="Red" FontSize="16" FontFamily="Verdana"> This is Label </Label>

The output looks like Figure 1.

 LabelImg1.gif

Figure 1. Label control
 

Further Readings
 
You may also want to read these related articles.

Ask Your Question

Got a programming related question? You may want to post your question here
 
© 2019 DotNetHeaven. All rights reserved.