在wpf中,如何将运行背景高度设置为行高?

时间:2016-06-19 08:07:58

标签: c# wpf styles richtextbox flowdocument

有没有办法将Height元素的背景Run设置为与WPF中的LineHeight相同?这是我的问题的演示,黄色背景是我的预期高度。 Demo of my question

    <RichTextBox IsReadOnly="True" Focusable="False" BorderThickness="0">
    <FlowDocument>
        <Paragraph LineHeight="30" LineStackingStrategy="BlockLineHeight">
            <Run>How to set the run element background height as LineHeight?</Run>
            <Run Background="Gray">How to set the run element background height as LineHeight?</Run>
            <Run>How to set the run element background height as LineHeight?</Run>
        </Paragraph>
    </FlowDocument>
</RichTextBox>

0 个答案:

没有答案