Edit this page

Getting Started

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

Design Time

  1. To add a RadPanel to your form, drag a RadPanel from the toolbox onto the surface of the form designer.
  2. In the Properties section in Visual Studio change the Dock property of RadPanel to Fill.
  3. Drag another control from the toolbox and place it on the panel.
  4. Click F5 to start the application.

Run Time

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

Figure 1: RadPanel Run-time

panels-and-labels-panel-getting-started 001

Adding a RadPanel at Run-time

RadPanel panel = new RadPanel();
this.Controls.Add(panel);
panel.ForeColor = Color.DarkBlue;
panel.BackColor = Color.LightBlue;
panel.PanelElement.PanelBorder.ForeColor = Color.Gray;
panel.Text = "I am a RadPanel!";

Dim panel As New RadPanel()
Me.Controls.Add(panel)
panel.ForeColor = Color.DarkBlue
panel.BackColor = Color.LightBlue
panel.PanelElement.PanelBorder.ForeColor = Color.Gray
panel.Text = "I am a RadPanel!"

Programming RadPanel

RadPanel shares most of the properties of the standard Windows Form Panel, 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 control`s text color.

  • The Text property sets the text in the control.

The example below has the BackgroundImage property set to the Progress logo.

Figure 2: RadPanel BackgroundImage

panels-and-labels-panel-getting-started 002

See Also