
I have a question:
I want to use underline style for some text. In editor I execute command _textBox.Commands.ToggleUnderlineCommand.Execute(isChecked ? TextDecorations.Underline : null);
How can I change underline color?
Thanks, Anatoly.
6 Answers, 1 is accepted
Custom colors for the underline are currently not supported. The color of the underline depends on the fore color of the text that is being underlined.
On a side note, the ToggleUnderlineCommand does not respect the parameter which can be passed to it, it just changes the state of the selection/current word - if the whole text is underlined, the underline is removed, otherwise - the whole selection/word is underlined.
If this is not the behavior you wish to have, you can use the ChangeUnderlineDecoration method or ChangeUnderlineDecorationCommand. You can also utilize the different Underline types as follows:
this
.radRichTextBox1.ChangeUnderlineDecoration(UnderlineTypes.DotDotDashedLine);
Iva
the Telerik team

Yes, by default - it's true.
But when I get Xaml from text box - I always get underline color '#FF000000'. But real fore color is white. And when I set this xaml to the text box - I get black underline.
Thanks for your question!
Actually there is a property in Telerik.Windows.Documents.Model.Span class called UnderlineColor. If you set it, its value will override the ForeColor property. Unfortunately currently there isn't an undoable command to change that property. However we will do our best to add it in the upcoming Q2.
Regards,
Vesko
the Telerik team


Unfortunately, this feature just missed the release deadline for Q2, but we have added it in the development version and it will be released in the next internal build.
All the best,Iva
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!