Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

This is my first post in here...

Iam working on a report editor based on wpf flow document, I have been able to display Text reports on Flow Document Scroll Viewer also i am able to annotate the content using Annotation Service

But now Iam intending to annotate that flow document content in a manner that only the alternate lines of text (like 1st,3rd,5th...) gets colored while the other (2nd,4th,6th...) ones remain as it is.

Iam not being able to get to the individual lines of text in flow document...once i achieve this, coloring will not be a big problem as WPF provides Annotation Service.

Please provide any help in this regard.....


My initial code ia as follows:

XML
namespace TextOnFlowDoc
{
    /// <summary>
    /// Interaction logic for Page1.xaml
    /// </summary>
    public partial class Page1 : Page
    {
        public Page1()
        {
            InitializeComponent();
            Paragraph paragraph = new Paragraph();
            paragraph.Inlines.Add(System.IO.File.ReadAllText(@"C:\Lis.txt"));
            paragraph.FontFamily = new FontFamily("CourierNew");
            FlowDocument document = new FlowDocument(paragraph);
            // FlowDocumentReader rdr = new FlowDocumentReader();
            FlowDocScl.Document = document;
        }
    }
}
Posted
Updated 17-May-11 19:32pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900