RadLabel <html><color=xxxx>

2 posts, 0 answers
  1. Gary
    Gary avatar
    23 posts
    Member since:
    Jul 2016

    Posted 22 Feb 2017 Link to this post

    I'm not using themes in my project yet but I would like this to work as if I were.  I'm setting up some RadLabels to contain both the name of the piece of information and the value of it.  I.E. RadLabel1.Text = string.Format("<html><color=Navy>Item Number: <color=Black>{0}", theItemNumber);

    How can I get the color name for the text at the top of the RadForm (or any control's forecolor that is used to display text)?

    Also, where I'm setting the color back to the default for the label, is Black the default or is there some place to find that color as well?

    Thank you,


  2. Dimitar
    Dimitar avatar
    2117 posts

    Posted 23 Feb 2017 Link to this post

    Hello Gary,

    Thank you for writing.

    You can get the ForeColor used in the title bar like this:
    var caption = this.FormElement.TitleBar.CaptionElement as TextPrimitive;
    var color = caption.ForeColor;

    There is no universal way to get the colors for any control. This depends on how the color is set in the theme. You can use Visual Style Builder to export the predefined themes and examine how the colors are set. The following articles are containing detailed information:
    I hope this will be useful. Let me know if you have additional questions.

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top