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

Cursor positioning

1 Answer 149 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 19 Dec 2014, 12:48 AM
One of users commented that the cursor in the rich text editor sits too close to the text.  In fact, the cursor overlaps the last typed character - when this is an "i" or an "l" it becomes difficult to see the last character.
In MS Word there is a small gap between the last character and the cursor.
Is it possible to move the cursor so that there is a small gap?
Screenshots of Telerik, and MS word attached

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Dec 2014, 02:05 PM
Hi Jason,

Thank you for contacting us.

I have examined this in our control and in Microsoft Word and it appears the caret is a bit wider in our control (in word it is 1 pixel). This depends on the font size as well, if you enlarge the font size you will notice that there is more space between the letters and the caret does not overlap them. What can be done in this case is to make the caret just one pixel wide:
private void radRichTextEditor1_GotFocus(object sender, EventArgs e)
{
    RadRichTextEditor editor = sender as RadRichTextEditor;
    editor.Document.Selection.SelectAll();
 
 
    DocumentWebLayoutPresenter presenter = editor.RichTextBoxElement.ActiveEditorPresenter as DocumentWebLayoutPresenter;
    Caret caret = typeof(DocumentWebLayoutPresenter).GetField("caretUI", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(presenter) as Caret;
    caret.Width = 1;
}

I hope this helps. Should you have any other questions do not hesitate to ask.
 
Regards,
Dimitar
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.

 
Tags
RichTextEditor
Asked by
Jason
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or