Caret in RichTextBox is invisible when appliaction is render mode is Aliased.

9 posts, 0 answers
  1. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 16 Sep 2014 Link to this post

    Hi,

    I have a poblem with your RichTextBox control. When i set render options in WPF application like this:

    RenderOptions.EdgeMode(dependencyObject, EdgeMode.Aliased);

    caret in richTextBox disappeared. To reproduce the problem font size should be set to less then 15 and font style should not be set to italic.

    ( I think that the problem is thickness of caret and the render of 1px width in this render mode)

    Please let my know how to set visibility of caret.
  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 19 Sep 2014 Link to this post

    Hello Maciej,
    As a whole setting of RenderOptions to RadRichTextBox is not supported, as this alters the presentation layer, while the internal measuring mechanism doesn't support it. As the RenderOptions is inheritable property, we can recommend to reset its value to the default one only for the RadRichTextBox:
    <Window RenderOptions.EdgeMode="Aliased">
    ...
        <telerik:RadRichTextBox RenderOptions.EdgeMode="Unspecified">
       ...


    Regards,
    Boby
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 19 Sep 2014 in reply to Boby Link to this post

    When RenderOptions of WPF control is set as RenderOptions.EdgeMode="Unspecified" it still inherit RenderOption from parent object.
    To make it work I have to change render option for root object example Window, but I do not want to do that. 

    Is any other way to make caret visible in Aliased Render Option?
  5. Boby
    Admin
    Boby avatar
    595 posts

    Posted 23 Sep 2014 Link to this post

    Hi Maciej,
    You are right, actually the trick suggested by me doesn't work. I was in a mistake thinking that the RenderOptions.EdgeMode would work similarly to TextOptions class properties.

    I will log the issue for further investigation, but for now with relatively low priority due to its specificity.

    Regards,
    Boby
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 23 Sep 2014 Link to this post

    Thanks for your answer.
    I hope that the defect will be repaired even of low priority of this issue.
    Please let my know when You repair it.

    Regards,
    Maciej 
  7. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 05 Nov 2014 Link to this post

    Hi 
    Is it possible that this bug will be fixed in the next version?

    Regards

    Maciek
  8. Boby
    Admin
    Boby avatar
    595 posts

    Posted 06 Nov 2014 Link to this post

    Hi Maciej,
    The bug is currently not scheduled. I think I found a possible workaround, but I will require upgrade to the latest version (2014 Q3). The trick is to change the width of the Caret:
    internal class FatCaretFactory : ICaretFactory
    {
        public Caret CreateCaret()
        {
            return new FatCaret();
        }
    }
     
    internal class FatCaret : Caret
    {
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
     
            this.Width = 2;
        }
    }
     
    public MainDemoControl()
    {
        InitializeComponent();
        this.radRichTextBox.CaretFactory = new FatCaretFactory();
        ...


    Regards,
    Boby
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 06 Nov 2014 in reply to Boby Link to this post

    Thank you for fast answer.
    I gonna try this solution as soon as possible. 

    Regards,
    Maciek
  10. Maciej
    Maciej avatar
    8 posts
    Member since:
    Jul 2012

    Posted 17 Dec 2014 in reply to Maciej Link to this post

    Works fine! Thank you so much.

    By the way, Merry Christmas.
Back to Top
UI for WPF is Visual Studio 2017 Ready