Edit this page

Getting Started

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();
this.Controls.Add(label);
label.ForeColor = Color.Green;
label.Text = "I am a RadLabel!";

Dim label As New RadLabel()
Me.Controls.Add(label)
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

panels-and-labels-label-programming-radlabel 001

See Also