#252 – (FlowDocument 自动调整文本流)FlowDocument Flows its Content Automatically

2016-09-08 19:58:35来源:CSDN作者:Libby1984人点击

FlowDocument 会自动调整其内部文本流的呈现以适应当前显示区域的大小。下面的例子中,我们将一个FlowDocument 包含在一个FlowDocumentScrollViewer中。

<FlowDocumentScrollViewer>        <FlowDocument FontFamily="Cambria" FontSize="14">            <Paragraph>There was no possibility of taking a walk that day.  We had been wandering, indeed, in the leafless shrubbery an hour in the morning; but since dinner (Mrs. Reed, when there was no company, dined early) the cold winter wind had brought with it clouds so sombre, and a rain so penetrating, that further out-door exercise was now out of the question.            </Paragraph>            <Paragraph>I was glad of it: I never liked long walks, .. etc. etc.

(代码中省略了部分文本内容)

显示结果如下,可以看到显示的文本会自动换行已适应文本宽度

调整显示区域的宽度,文本会自动调整


原文地址:https://wpf.2000things.com/2011/03/21/252-flowdocument-flows-its-content-automatically/



最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台