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

rad Label <html> does not support <color=inherit>

3 Answers 145 Views
Label
This is a migrated thread and some comments may be shown as answers.
Alexey
Top achievements
Rank 1
Alexey asked on 03 Jun 2020, 11:04 PM

How can I switch back to the default label color?

<html><color=inherit> does not work

 

Thanks!

3 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 04 Jun 2020, 03:11 PM

Hello Alexey,

In order to switch back to the default color, you can store the default color in a separate variable and later restore it by assigning it to the specified property that you would like to change. Here is an example with BackColor of RadLabel:

Color defaultColor = this.radLabel1.BackColor;
this.radLabel1.BackColor = Color.Red;
// switch to default color
this.radLabel1.BackColor = defaultColor;

Another possible solution is to assign the Color.Empty value.

I hope this helps. Do not hesitate to contact me if you need further assistance.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Alexey
Top achievements
Rank 1
answered on 04 Jun 2020, 03:30 PM
Thanks! That is simple solution for RadLabel, but it is a patch to obtain existed color. Sometimes it is difficult to obtain original color, such as for controls showing active status. ForeColer property for rabTabPage is always the same, ignoring its active status. How can I determine a tab page forecolor for active or not active tab, when I use an html tag? Thanks!
0
Nadya | Tech Support Engineer
Telerik team
answered on 09 Jun 2020, 08:43 AM

Hello Alexey,

By default, the elements in Telerik UI for Winforms suit inherit the color from their parent element if they are not explicitly set. If you want to get the default color it is necessary to access the ForeColor/BackColor of the specific element. However, we do not have a special <color=inherit> tag. Please refer to the following article that contains the supported HTML tags: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/html-like-text-formatting.

If you have other specific requirements I would kindly ask you to provide more information about which specific control you use and what you are trying to achieve.

Let me know if I can assist you further.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Label
Asked by
Alexey
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Alexey
Top achievements
Rank 1
Share this question
or