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

  • SEARCH
  • Home
  • 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 RichTextBox on a WPF window that I am using kind of
I am creating a class that derives from the WPF RichTextBox control and I
I have wpf user control <StackPanel Orientation=Horizontal> <TextBox Name=txbInterval Text=5/> <Image Name=imgStart Source=Images/start.png/> <Image
I have WPF window that uses a dockpanel and the menu control. I have
I have a small WPF application that hosts a RichTextBox: <RichTextBox SpellCheck.IsEnabled=True FontFamily=Verdana AcceptsTab=True
I have a WPF RichTextBox with isReadOnly set to True . I would like
I have a richtextbox (WPF extended toolkit) that I am using in my WPF
I have a RichTextBox in a WPF Application. I would like to apply alternate
I have a richtextbox control in my WPF 4.0 application. Now suppose I have
I am using WPF and have a Table inside a RichTextBox control. I need

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.