New to Telerik UI for WinForms? Download free 30-day trial

Getting Started with WinForms Label

You can add a Radlabel either at design time or at run-time:

Design Time

  1. To add a Radlabel to your form, drag a Radlabel from the toolbox onto the surface of the form designer.
  2. In the Properties section in Visual Studio change the Text property of Radlabel.
  3. Click F5 to start the application.

Run Time

To programmatically add a Radlabel to a form, create a new instance of a Radlabel, and add it to the form`s Controls collection. Change its Text and ForeColor properties.

Adding a Radlabel at Run-time

RadLabel label = new RadLabel();
label.ForeColor = Color.Green;
label.Text = "I am a RadLabel!";

Dim label As New RadLabel()
label.ForeColor = Color.Green
label.Text = "I am a RadLabel!"

Programming RadLabel

RadLabel shares most of the properties of the standard Windows Form Label, including:

  • The BackColor property sets the background color of the control.

  • The BackgroundImage and BackgroundImageLayout properties allow you to tile, center, stretch, or zoom an image across the control.

  • The ForeColor property sets the color of control`s text.

  • The Text property sets the text in the control.

The example below has the BackgroundImage property set to "BlueHills.jpg" (available in the \Samples Pictures directory of many Windows installations) and BackgroundImageLayout set to Stretch. The ForeColor property is set to White.

Figure 1: RadLabel BackgroundImage

WinForms RadLabel BackgroundImage

See Also

Telerik UI for WinForms Learning Resources

In this article