tags:

views:

14

answers:

1

Hi, I have rich text box and i save it's content to RTF file. However, i'm trying to set background color to the paragraph, but the richTextBox.Backgroung doesn't work, i also try to use the selectedText property - but it's colorize only the the text... Any idea?

A: 

Hi, if you select the paragraph you want to change the background for you should be able to use richTextBox1.SelectionBackColor = Color.Blue;.

Mikael
i tryied it, but it colorize only the text lines (like highlited text), not all the paragraph
achi
Hi, I probably missunderstood a little. Are you using WPF? Have you seen the examples on http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx ? The Paragraph element should accept Brushes when setting the Background property.
Mikael