Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6244671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:21:58+00:00 2026-05-24T12:21:58+00:00

I have a WPF RichTextBox control that I want to behave like a normal

  • 0

I have a WPF RichTextBox control that I want to behave like a normal RichTextBox in every way except that the user cannot edit the text and the caret is not visible. The issue I’m having is that when I change IsReadOnly to False, the RichTextBox stops reacting to keystrokes. I want it to respond normally to keystrokes like Home, End, PgUp, PgDn, Up, Down. The documentation doesn’t mention this behavior.

<RichTextBox
    IsReadOnly="True"
    ScrollViewer.VerticalScrollBarVisibility="Visible"
    Width="65" Height="20">
    <FlowDocument>
        <Paragraph>
            Line 1
            Line 2
            Line 3
        </Paragraph>
    </FlowDocument>
</RichTextBox>

I’ve tried adding an OnKeyDown event handler, but it doesn’t fire. I’ve watched the events in Snoop as I push keys with the RichTextBox in keyboard focus and no fired events are shown in Snoop. I’ve tried setting IsDocumentEnabled explicitly to True, but that also has no effect. I’ve tried wrapping the RichTextBox in a ScrollViewer, but this has no effect either.

Any suggestions for how I can maintain this RichTextBox as IsReadOnly=True, but get the expected keystroke behavior of a RichTextBox?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:21:59+00:00Added an answer on May 24, 2026 at 12:21 pm

    Set IsReadOnlyCaretVisible to True

    <RichTextBox IsReadOnly="True"
                 IsReadOnlyCaretVisible="True"
                 ... />
    

    If you don’t want the caret to be visible then set the CaretBrush to Transparent

    <RichTextBox IsReadOnly="True"
                 IsReadOnlyCaretVisible="True"
                 CaretBrush="Transparent"
                 ... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF control, that has a list of Investors, and in the
How can I use RichTextBox Target in WPF application? I don't want to have
I have several wpf pages with update/delete/add buttons. I want to display to the
I have a WPF ListView that is bound to a BindingList<T>. The binding works
I have a WPF ListView which repeats the data vertically. I cannot figure out
I have a WPF application that has several modal window used for various purposes.
I Have a WPF window that have a RadGridView and a Button, My requirement
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have a WPF project and I'm trying to setup a NAnt build script
I have a WPF application in VS 2008 with some web service references. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.