任务:使InlineUIContainer的文本内容与外部文本内联
InlineUIContainer 内容的标准行为是当底部边缘与外部文本内联时。
可以使用 RenderTransform 移动 InlineUIContainer 的内容,但必须为每种字体类型和大小选择 Y 的值 - 这不是一个完美的方法。
<RichTextBox>
<FlowDocument>
<Paragraph>
LLL
<InlineUIContainer>
<Border Background="LightGoldenrodYellow">
<TextBlock Text="LLL"/>
</Border>
</InlineUIContainer>
LLL
</Paragraph>
<Paragraph>
LLL
<InlineUIContainer>
<Border Background="LightGoldenrodYellow">
<Border.RenderTransform>
<TranslateTransform Y="5" />
</Border.RenderTransform>
<TextBlock Text="LLL"/>
</Border>
</InlineUIContainer>
LLL
</Paragraph>
</FlowDocument>
</RichTextBox>
如何将 InlineUIContainer 内容中的文本与 RichTextBox 中的外部文本对齐,无论字体类型和大小如何?
你有没有尝试过玩弄InlineUIContainer.BaselineAlignment http://msdn.microsoft.com/en-us/library/system.windows.documents.inline.baselinealignment.aspx
here http://msdn.microsoft.com/en-us/library/system.windows.baselinealignment.aspx有一些如何使用它的示例
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)