ThickLineDecoration not showing up as Thick

5 posts, 1 answers
  1. Mia
    Mia avatar
    9 posts
    Member since:
    Jul 2013

    Posted 21 Jul 2013 Link to this post

    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);

  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 24 Jul 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Mia
    Mia avatar
    9 posts
    Member since:
    Jul 2013

    Posted 05 Aug 2013 Link to this post

    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
  5. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 08 Aug 2013 Link to this post

    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 >>
  6. Mia
    Mia avatar
    9 posts
    Member since:
    Jul 2013

    Posted 14 Oct 2013 Link to this post

    Thanks Iva, that worked well.
Back to Top
DevCraft banner