我正在尝试使用WPF RichTextBox和工具栏重新创建MSWord,所以最近的问题之一是:
在MSWord文档中...
...with字体系列时代新罗马字体,11,对齐一行包含95个字符...with字体系列时代新罗马字体,11,对齐,加粗一行包含83个字符
关于页边距,更推荐使用页边距或限制每行字符数?因为当用户输入是时。或者其他ASCII的大小比其他ASCII短,单行中的最大字符数“改变”。那么,如果使用边距是最恰当的-那么WPF RichTextBox如何管理边距呢?
谢谢!
发布于 2009-03-12 18:11:59
对我来说,尝试限制每行字符数听起来像是噩梦。你最好去掉RichTextBox的默认ControlTemplate,这样你就只有文本了,然后在你的RichTextBox上设置Margin,让文本“浮动”在中间:
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ScrollViewer>
<RichTextBox Margin="30,0">
<RichTextBox.Template>
<ControlTemplate TargetType="{x:Type RichTextBox}">
<Border x:Name="PART_ContentHost" Margin="2" Background="Transparent" BorderBrush="Transparent"/>
</ControlTemplate>
</RichTextBox.Template>
</RichTextBox>
</ScrollViewer>
</Grid>https://stackoverflow.com/questions/639634
复制相似问题