当我使用 Richtextbox 进行文本编辑时,行间距很大,但是当我在 FlowDocument 中打开相同的文本/文件时,它看起来非常好。有没有一种简单的方法可以更改 Richtextbox 中的行距以与 FlowDocument 的行距相匹配?
Paragraph paragraph = new Paragraph();
paragraph.Inlines.Add(dataContent);
FlowDocument document = new FlowDocument(paragraph);
selectedRTB.Document = document;
selectedTabItem.Content = selectedRTB;
最佳答案
<RichTextBox >
<FlowDocument>
<Paragraph LineHeight="50">
Paragraph1
</Paragraph>
<Paragraph LineHeight="20">
Paragraph2
</Paragraph>
</FlowDocument >
</RichTextBox>
尝试一下。
关于c# - 如何在 WPF C# 中设置 RichTextBox 中文本的行距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24072274/