扩展WPF工具包的RichTextBox显示文本垂直 [英] Extended WPF Toolkit RichTextBox display text vertically

查看:1100
本文介绍了扩展WPF工具包的RichTextBox显示文本垂直的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过它的Text属性像这样丰富的内容(RTF格式)到丰富的文本框(扩展WPF工具包)结合

I'm trying to bind a rich content (RTF format) to a rich text box (of Extended WPF Toolkit) via its Text property like this

<extToolkit:RichTextBox x:Name="rtbKIContent" Margin="8,8,8,8" 
                                    IsEnabled="{Binding IsEditable}"
                                    Text="{Binding Content}">
                <extToolkit:RichTextBox.TextFormatter>
                    <extToolkit:RtfFormatter></extToolkit:RtfFormatter>

                </extToolkit:RichTextBox.TextFormatter>
                <extToolkit:RichTextBoxFormatBarManager.FormatBar>
                    <extToolkit:RichTextBoxFormatBar />
                </extToolkit:RichTextBoxFormatBarManager.FormatBar>
</extToolkit:RichTextBox>

有时,它工作得很好,但也有他们只是显示的文本垂直像这样的情况。

Sometimes it works just fine, but there are circumstances that they just display the text vertically like this.

我不知道什么地方错了......我应该怎么做,使之显示文本从左至右像正常?

I don't know what's wrong with it...What should I do to make it display text from left to right like normal?

推荐答案

如果您添加宽度RichTextBox的,它应该修复它。

If you add a width to the RichTextBox, it should fix it.

我这样做,所以它绑定到父。

I did this so it binds to the parent.

Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Grid, AncestorLevel=1}, Path=ActualWidth}"

请注意,你必须确定的 AncestorType 为您服务。但你可以做到这一点。 WIDTH =100

Note you will have to determine AncestorType for you. But you can do this too. Width="100"

这篇关于扩展WPF工具包的RichTextBox显示文本垂直的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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