如何调整段之间的空间通过编程的流文件中 [英] How to adjust the space between paragraph in a flow document by programming

查看:99
本文介绍了如何调整段之间的空间通过编程的流文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#WPF中beginer,我想和通过编程几个paragrah流文件。
的问题是,有pagraphs之间有很大的空间,我想将它调整到最低限度。



我找到了一个解决方案,通过使用XML语句,但我想通过编程,使其:

 <&FlowDocument的GT; 
< FlowDocument.Resources>
<! - 这种风格被用于在FlowDocument的所有段落的页边距设置为0 - >
<风格的TargetType ={X:类型的段落}>
< setter属性=保证金VALUE =0/>
< /样式和GT;
< /FlowDocument.Resources>

<&款GT;段落之间
间距是由段落设置页边距造成的。两个相邻的利润
就崩溃两个边距宽度较大,而不是增加了一倍。
< /段>

<&款GT;
。要消除额外间距两个段落之间只设置段落边距为0
< /段>
< / FlowDocument的>



我该怎么办呢?



感谢名单对你的帮助。


解决方案

没有编程是必要的。



<$ P:对的FlowDocument 为我工作的 PagePadding 属性$ p> <的FlowDocument PagePadding =0>

MSDN定义PagePadding




获取或设置一个值,该值指示填充空间的厚度页面的边界和页面的内容之间。



I'm a beginer in C# Wpf and I want to make a flow document with few paragrah by programming. The problem is that there is a big space between pagraphs and i want to resize it to its minimum.

I found a solution by using a Xml statement, but i want to make it by programming :

<FlowDocument>
  <FlowDocument.Resources>
    <!-- This style is used to set the margins for all paragraphs in the FlowDocument to 0. -->
    <Style TargetType="{x:Type Paragraph}">
      <Setter Property="Margin" Value="0"/>
    </Style>
  </FlowDocument.Resources>

  <Paragraph>
    Spacing between paragraphs is caused by margins set on the paragraphs.  Two adjacent margins
    will "collapse" to the larger of the two margin widths, rather than doubling up.
  </Paragraph>

  <Paragraph>
    To eliminate extra spacing between two paragraphs, just set the paragraph margins to 0.
  </Paragraph>
</FlowDocument>

How can i do it ?.

thanx for you're help.

解决方案

No "programming" is necessary. The PagePadding property on FlowDocument worked for me:

<FlowDocument PagePadding="0">

MSDN definition for PagePadding:

Gets or sets a value that indicates the thickness of padding space between the boundaries of a page and the page's content.

这篇关于如何调整段之间的空间通过编程的流文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆