如何在WPF中使用前景颜色在DataBase上保存RichTextBox值? [英] How can Save RichTextBox Value on DataBase with Its Foreground Color in WPF?
本文介绍了如何在WPF中使用前景颜色在DataBase上保存RichTextBox值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
i有一个wpf窗口有几个控件,比如sa Button,RichTextBox等
我的策略是在DataBase中保存RichTextBox值及其前景颜色,当加载信息时,有前景色。
我怎么做?
Hi
i have a wpf window that has several control such sa Button,RichTextBox,etc
my policy is that save RichTextBox Value with its Foreground Color in DataBase ,and when load information ,has Foreground color.
How i can do this?
推荐答案
你可以将颜色保存为3或4个整数值,RGB或ARGB 。至于RichTextBox,存储其格式化的内容,RTF文件的内容(例如System.Windows.Forms.Rtf
属性值,但它取决于RichTextBox的确切类型;你没有指定它;这个名字下有一种以上的类型。)
-SA
You can save the color as 3 or 4 integer values, RGB or ARGB. As to RichTextBox, store its formatted content, content of the RTF file (such asSystem.Windows.Forms.Rtf
property value, but it depends on exact type of "RichTextBox"; you did not specify it; there is more then one type under this name).
—SA
>
这篇关于如何在WPF中使用前景颜色在DataBase上保存RichTextBox值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文