Remove RadRichTextBox Cursor

3 posts, 0 answers
  1. Kevin
    Kevin avatar
    2 posts
    Member since:
    Sep 2011

    Posted 24 Oct 2011 Link to this post

    Hi

    I'm trying to use a telerik RadRichTextBox for my windows form.  Is there a way I can remove the cursor from the control after inserting the value using the following line:

        RADRichTextBox1.Insert('xxx')

        RADRichTextBox2.Insert('yyyy')

    Please see the attachment for reference. 


  2. Kevin
    Kevin avatar
    2 posts
    Member since:
    Sep 2011

    Posted 26 Oct 2011 Link to this post

    Can anyone please help me on this?

    Thank you.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Svett
    Admin
    Svett avatar
    728 posts

    Posted 26 Oct 2011 Link to this post

    Hi Steve,

    I managed to reproduce the issue. It will be addressed in the upcoming release. In the meantime, you can create a custom caret to work around the issue:

    public class MyCaret : RadCaret, IEditorCaret
    {
        private DocumentView documentView;
     
        public MyCaret(DocumentView documentView)
            : base(documentView)
        {
            this.documentView = documentView;
        }
     
        void IEditorCaret.Show()
        {
            if (this.documentView.IsFocused)
            {
                this.Show();
            }
        }
    }

    this.radRichTextBox1.DocumentView.Caret = new MyCaret(this.radRichTextBox1.DocumentView);
    this.radRichTextBox2.DocumentView.Caret = new MyCaret(this.radRichTextBox2.DocumentView);

    I updated your Telerik points.

    All the best,
    Svett
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top