Cursor positioning

2 posts, 0 answers
  1. Jason
    Jason avatar
    18 posts
    Member since:
    Aug 2014

    Posted 18 Dec 2014 Link to this post

    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
  2. Dimitar
    Dimitar avatar
    2960 posts

    Posted 23 Dec 2014 Link to this post

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

    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.

Back to Top