How to change hyperlink color in RadLabel?

2 Answers 57 Views
Label
Pawel
Top achievements
Rank 1
Iron
Pawel asked on 20 Sep 2023, 10:31 AM

Hi,

I'm using my custom template and I would like to adjust the hyperlink color in RadLabel.

Is there a way to change the color of the hyperlink? The hyperlink is set using an HTML tag. For example: "lblMessageText.Text = "<html>New software version: <a href=www.xyzcom/update>www.xyz.com/update</a>."?

Best regards

Pawel

2 Answers, 1 is accepted

Sort by
1
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 20 Sep 2023, 11:01 AM

Hello, Pawel,

In order to change the hyperlink color just set the TinyHTMLParsers.LinkColor static property:

TinyHTMLParsers.LinkColor = Color.GreenYellow;

Do not hesitate to contact me if you have other questions.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Pawel
Top achievements
Rank 1
commented on 21 Sep 2023, 08:22 AM

I have another question about hyperlinks set in the html tag.
Is there a way to subscribe to the on_click event on the hyperlink?
0
Nadya | Tech Support Engineer
Telerik team
answered on 25 Sep 2023, 07:42 AM

Hello, Pawel,

Note, HTML-like Text Formatting is just an advanced text styling mechanism, that would allow you to easily format your labels using HTML tags. Subscribing to the click event on the hyperlink in the label is not supported out of the box.

This functionality, however, can be accomplished. I recommend you to look at the following KB article: How to create RadLinkLabel - Telerik UI for WinForms. You can create such a custom RadLinkLabel and override its OnClick method where you can handle the click event and implement the desired behavior. 

I hope this information helps. Should you have further questions, do not hesitate to contact me.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Label
Asked by
Pawel
Top achievements
Rank 1
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or