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

ThickLineDecoration not showing up as Thick

4 Answers 63 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Mia
Top achievements
Rank 1
Mia asked on 22 Jul 2013, 04:42 AM
Hi, 

I have been trying to add some underlines to some selected text. I want the underlines to be thick and colourful so changing the span underlinedecoration came to my mind. None of the below underline decoration settings worked, but changing the fontsize or anything else about the span seemed to work fine. What should I do/add/change/combine in this case to make it work?

   var a = new DoubleCollection {length, 0};
   span.UnderlineDecoration = new ThickLineDecoration(a);
   span.UnderlineDecoration = UnderlineTypes.ThickLine;
   radRichTextBox.ChangeUnderlineDecoration(UnderlineTypes.ThickLine);

4 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 24 Jul 2013, 12:17 PM
Hello,

In order to underline the current selection or the inline where the caret is located in case the selection is empty, you should use the ChangeUnderlineDecoration() method of RadRichTextBox.
this.radRichTextBox.ChangeUnderlineDecoration(UnderlineTypes.ThickLine);

That said I am not sure why you are having troubles with this, so we will appreciate it if you can provide further details on the issue or a sample project that demonstrates it.

I'm looking forward to your reply.
 
Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mia
Top achievements
Rank 1
answered on 06 Aug 2013, 03:18 AM
The "Thickline " looks just like a line -- not thick enough when i have the font size of 11pt on a document. 

Can i customise the underline decoration somewhere so that the thick line shows up as thick as i want? I want it to be very obvious on the document, a line/thickline/doubeline is far too thin for me in this case. 

I've been working on this for a long time, just trying to get a really thick line under certain texts, and inserting table cells did not work since table wont wrap around the text in the same line.. i'm running out of ideas, it'll be good that i can just change the thickness to be what i want for the thickline decoration. Looking forward to your answer. Thanks.

Regards,
Mia
0
Accepted
Iva Toteva
Telerik team
answered on 08 Aug 2013, 04:36 PM
Hello Mia,

RadRichTextBox uses UILayers in order to show different types of content - images, table borders, highlights, etc. The underline decorations also have a dedicated layer. You can try creating a custom UI layer that shows thicker lines under the text when it has Thick underline applied. You can find basic information in this help article and check the demos for creating a custom UI layer in the online examples and preview/download the source of the example (as a standalone application) here.

In your case you can create a custom UI layer that filters the spans depending on the UnderlineDecoration and add UIElements to the layer that will make the line thicker.

Have in mind, though, that the UILayers are used for presentation purposes only, so when exported to docx, rtf, etc., the size of the underlines will remain thinner.


Regards,
Iva Toteva
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mia
Top achievements
Rank 1
answered on 14 Oct 2013, 10:23 PM
Thanks Iva, that worked well.
Tags
RichTextBox
Asked by
Mia
Top achievements
Rank 1
Answers by
Petya
Telerik team
Mia
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or