使用文本属性从Richtectbox读取数据 [英] Read data from Richtectbox with text attributes

查看:163
本文介绍了使用文本属性从Richtectbox读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在使用richtextbox(WPF),它显示带有下划线,大字体等的文本。



问题是我无法读取每个字符或文本的文本属性。



textchange事件我正在读取整个数据显示在richtectbox中并保存。



如何实现这个目标?



请帮助。



谢谢。

Hello,

I'm using richtextbox (WPF)in which it displays text with underline, large font etc.

The problem is I'm not able to read text attribute of each character or text.

on textchange event I'm reading whole data displayed in richtectbox and saving it.

How to achieve this?

Please help.

Thanks.

推荐答案

首先,您没有指定用于保存文本的方法。 RichTextBox到一个文件,反之亦然。



看看这里:RichTextBox.Rtf Property [ ^ ]。它可以获取或设置RichTextBox控件的文本,包括所有富文本格式(RTF)代码



WD:RTF格式(RTF)规范版本1.7可用 [ ^ ]

如何:将RTF转换为纯文本(C#编程指南) [ ^ ] - 许多有用的信息
First of all, you did not specify the method you're using to save text from RichTextBox to a file and vice-versa.

Have a look here: RichTextBox.Rtf Property [^]. It enables to get or set the text of the RichTextBox control, including all rich text format (RTF) codes.

WD: Rich Text Format (RTF) Specification Version 1.7 Available[^]
How to: Convert RTF to Plain Text (C# Programming Guide)[^] - many useful information


这篇关于使用文本属性从Richtectbox读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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