自学WPF--第八课FlowDocument

本文档详细介绍了WPF中的FlowDocument类,它提供了高级文档功能,包括分页和列。通过示例代码展示了如何创建FlowDocument,包括段落、字体样式、列表、下划线、上标、下标、分段和换页等,帮助开发者掌握FlowDocument的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  

FlowDocument类,用高级文档功能(如分页和列)承载流内容和设置流内格式。

需要添加引用,PresentationFramework(在 PresentationFramework.dll 中),不然就报错误~

示例代码如下:

 

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <FlowDocument

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Paragraph FontSize="18">Flow Format Example</Paragraph>

    <!--Paragraph:将内容分组到一个段落中的块级别流内容元素-->

    <Paragraph>

        Lorem ipsum dolor sit amet,consectetuer adipiscing elit, sed diam nonummy

      nibh euismod tincidunt ut laoreet dolore
magna aliquam erat volutpat. Ut wisi 

      enim ad minim veniam, quis nostrud exerci
tation ullamcor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值