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

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

8 Answers 142 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Maciej
Top achievements
Rank 1
Maciej asked on 16 Sep 2014, 10:40 AM
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.

8 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 19 Sep 2014, 10:37 AM
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.
 
0
Maciej
Top achievements
Rank 1
answered on 19 Sep 2014, 11:17 AM
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?
0
Boby
Telerik team
answered on 23 Sep 2014, 09:47 AM
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.
 
0
Maciej
Top achievements
Rank 1
answered on 23 Sep 2014, 10:24 AM
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 
0
Maciej
Top achievements
Rank 1
answered on 05 Nov 2014, 11:01 AM
Hi 
Is it possible that this bug will be fixed in the next version?

Regards

Maciek
0
Boby
Telerik team
answered on 06 Nov 2014, 12:20 PM
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.

 
0
Maciej
Top achievements
Rank 1
answered on 06 Nov 2014, 12:37 PM
Thank you for fast answer.
I gonna try this solution as soon as possible. 

Regards,
Maciek
0
Maciej
Top achievements
Rank 1
answered on 17 Dec 2014, 02:26 PM
Works fine! Thank you so much.

By the way, Merry Christmas.
Tags
RichTextBox
Asked by
Maciej
Top achievements
Rank 1
Answers by
Boby
Telerik team
Maciej
Top achievements
Rank 1
Share this question
or