title: WPF Textbox selection foreground color change
body: <p>I want to change the foreground color of a TextBox in WPF. Here is the code:</p>
  
  <pre><code>foreach (Match m in RedWord)
  {
      TextBox1.SelectionStart = m.Index;
      TextBox1.SelectionLength = m.Length;
      TextBox1.Select(m.Index, m.Length);
      TextBox1.SelectionBrush = Brushes.Red;
      //EditorTextBox.Foreground = Brushes.Red;
  }
  </code></pre>
  
  <p>The <code>.SelectionBrush</code> does not appear to apply the foreground text color as I need it. How can I change my text foreground color on selection?</p>