TextFlow 元素在 WPF 中是否有效

发布于 2024-07-26 04:57:54 字数 77 浏览 4 评论 0原文

由于某种原因,我无法在 WPF 中使用 TextFlow 元素。 这个元素/控件是否可用?

我用的是VS 2008。

For some reason I am not able to use the TextFlow element in WPF. Is this element/control even available?

I am using VS 2008.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

世界如花海般美丽 2024-08-02 04:57:54

如果你想避免 FlowDocument 的默认镶边,你可以自己指定查看器:

<FlowDocumentScrollViewer>
    <FlowDocument>
        <Paragraph>
            <Run>Hello</Run>
            <Run Background="Yellow">World</Run>
        </Paragraph>
    </FlowDocument>
</FlowDocumentScrollViewer>

If you want to avoid the default chrome of the FlowDocument, you can specify the viewer yourself:

<FlowDocumentScrollViewer>
    <FlowDocument>
        <Paragraph>
            <Run>Hello</Run>
            <Run Background="Yellow">World</Run>
        </Paragraph>
    </FlowDocument>
</FlowDocumentScrollViewer>
迷离° 2024-08-02 04:57:54

没有 TextFlow 元素。
您在寻找 FlowDocument 吗?

<ContentControl>
    <FlowDocument>
        <Paragraph>
            <Run>Hello</Run>
            <Run Background="Yellow"> World</Run>
        </Paragraph>
    </FlowDocument>
</ContentControl>

There is no TextFlow element.
Were you looking for FlowDocument?

<ContentControl>
    <FlowDocument>
        <Paragraph>
            <Run>Hello</Run>
            <Run Background="Yellow"> World</Run>
        </Paragraph>
    </FlowDocument>
</ContentControl>
木落 2024-08-02 04:57:54

您还可以使用 TextBlock:

<TextBlock><Run>Hello</Run><Run Background="Yellow">World</Run></TextBlock>

You can also use a TextBlock:

<TextBlock><Run>Hello</Run><Run Background="Yellow">World</Run></TextBlock>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文