This is a migrated thread and some comments may be shown as answers.

RadLabel <html><color=xxxx>

1 Answer 77 Views
Label
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 22 Feb 2017, 09:26 PM

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,

Gary

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Feb 2017, 02:26 PM
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.

Regards,
Dimitar
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.
Tags
Label
Asked by
Jay
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or