This is a migrated thread and some comments may be shown as answers.

LineSpacing and Text Highlighting\Selection

1 Answer 66 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Luke Daugherty
Top achievements
Rank 1
Luke Daugherty asked on 17 Aug 2011, 10:07 PM
I saw some previous posts asking how to reduce the spaces in between lines and in these forums I saw I could do:

        private void TxtDataProvider_SetupDocument(object sender, Telerik.Windows.Documents.FormatProviders.SetupDocumentEventArgs e)
        {
            e.Document.LineSpacing = .25;
        }

But when I do this, the selection\highlighting on the last line displayed is only as thick as the LineSpacing (meaning it highlights the top 1/4 of the actual text). If there is a newline this is not a issue and text selection highlights as would be expected.

How can I work around this?

Luke

1 Answer, 1 is accepted

Sort by
0
Luke Daugherty
Top achievements
Rank 1
answered on 17 Aug 2011, 10:18 PM
Figures I'd find a way after posting. Doing this:

        private void TxtDataProvider_SetupDocument(object sender, Telerik.Windows.Documents.FormatProviders.SetupDocumentEventArgs e)
        {
            Section section = new Section();
            Paragraph paragraph = new Paragraph();
            paragraph.FontSize = 12;
            paragraph.SpacingAfter = 1.15;
            section.Blocks.Add(paragraph);
            e.Document.Sections.Add(section);
        }

Worked much better for me.
Tags
RichTextBox
Asked by
Luke Daugherty
Top achievements
Rank 1
Answers by
Luke Daugherty
Top achievements
Rank 1
Share this question
or