Edit this page

TextBox and Label Decoration

Child controls decoration

RadCaptcha offer two composite properties - TextBoxDecoration and TextBoxLabelDecoration that offer properties to apply style decoration (Figure 1) following the standard System.Web.UI.WebControls.WebControl decoration properties. You can set BackColor, Font, etc.

In the following example we will customize the border of the TextBox and the Font style of the TextBoxLabel.

<telerik:RadCaptcha ID="RadCaptcha1" runat="server">
    <TextBoxDecoration BorderColor="Gray" BorderStyle="Solid" BorderWidth="2px" />
    <TextBoxLabelDecoration ForeColor="Gray" Font-Italic="true" Font-Names="Verdana, Arial, Georgia" />
RadCaptcha1.TextBoxDecoration.BorderColor = Color.Gray;
RadCaptcha1.TextBoxDecoration.BorderStyle = BorderStyle.Solid;
RadCaptcha1.TextBoxDecoration.BorderWidth = Unit.Pixel(2);

RadCaptcha1.TextBoxLabelDecoration.Font.Names = new string[] { "Verdana", "Arial", "Georgia" };
RadCaptcha1.TextBoxLabelDecoration.Font.Italic = true;
RadCaptcha1.TextBoxLabelDecoration.ForeColor = Color.Gray;
RadCaptcha1.TextBoxDecoration.BorderColor = Color.Gray
RadCaptcha1.TextBoxDecoration.BorderStyle = BorderStyle.Solid
RadCaptcha1.TextBoxDecoration.BorderWidth = Unit.Pixel(2)

RadCaptcha1.TextBoxLabelDecoration.Font.Names = New String() {"Verdana", "Arial", "Georgia"}
RadCaptcha1.TextBoxLabelDecoration.Font.Italic = True
RadCaptcha1.TextBoxLabelDecoration.ForeColor = Color.Gray

Figure 1: RadCaptcha with decorated TextBox and TextBoxLabel


See Also

Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article