Take the 2-minute tour ×

I'm attempting to extend a RichTextBox, so as to add some extra functionality; however, I'm running into a strange issue with the background color of my extended RTB. Here is the code:


public class RichTextBoxExtended: RichTextBox
    // completely empty


<UserControl x:Class="MyNamespace.MyView"
        <RichTextBoxExtended />

However, when showing this in a WPF page, the background color of the text box is gray, as if it were disabled (which it isn't, since I can still type into it fine). As a test, I replaced <RichTextBoxExtended /> in the XAML with <RichTextBox />, and that control is white as expected.

Does anyone know what could cause this issue? I can easily work around the problem by manually setting the background color to white, but am looking for a better solution.

share|improve this question
It's working here....can you show where you are using the UserControl...show the XAML please. –  colinsmith Sep 6 '12 at 13:13
I am not having that problem at all. –  Michael Mankus Sep 6 '12 at 13:14
Try using Snoop - The wpf spy utility to inspect the issue - snoopwpf.codeplex.com –  Harsh Baid Sep 6 '12 at 13:44

1 Answer 1

up vote 1 down vote accepted

I just copy paste your code to a test solution, place a frame in main window and put the RichTextBoxExtended in a page inside the frame, but the background of RTB is completely white. I think there is something else causing the problem.

share|improve this answer

Your Answer


