Take the 2-minute tour ×  I have a RichTextBox in a WPF
Application. I would like to apply alternate coloring to each
lines of texts. I have set the Background property to be of the
desired color, but due to differences in text length, only the
portion containing text gets the background color. How to set
properties so that the entire line is set to the desired
background color.  One non-elegant solution is to, pad some
spaces, but if RichTextBox layout changes, then the code needs
to be changed by trial and error basis.  Any better approach?
share|improve this question Can you please post your code about
how you defined color ? –  Upendra Chaudhari Sep 27 '11 at 7:37
Can you explain the user actions? Should I assume this is what
you are doing.... 1. Type 3 lines below each other. 2. Select
one of the lines and set background color. 3. expect the
background to span across the width of the rich text box /
horizontal scroll bar for that line? –  WPF-it Sep 27 '11 at
9:15 @AngelWPF: There won't be any horizonta