郁闷 写好提交结果没成功,刚写好的都不见了。没有心情再写了。直接保存代码
string abc2 = ("<FlowDocument xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"><Paragraph><Bold>haha</Bold><LineBreak /><Italic>yeye</Italic><Bold>haha</Bold></Paragraph></FlowDocument>"); string abc = ("<p><b>haha</b><br /><i>yeye</i><b>haha</b></p>"); TextRange range = new TextRange(txtRichText.Document.ContentStart, txtRichText.Document.ContentEnd); using (MemoryStream msDocument = new MemoryStream((new ASCIIEncoding()).GetBytes(abc2))) { FlowDocument _formattedDocument = XamlReader.Load(msDocument) as FlowDocument; txtRichText.Document = _formattedDocument; }
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/09c0d0da-5d69-49fb-ab06-7e9f47326816
http://blogs.msdn.com/jfoscoding/archive/2006/01/16/513383.aspx
http://www.c-sharpcorner.com/UploadFile/mahesh/WPFRichTextBox09072008194855PM/WPFRichTextBox.aspx
本文介绍了如何使用WPF中的富文本框(RichTextBox)来显示和编辑格式化的文本。通过示例代码展示了如何将带有格式的文本字符串加载到富文本框中,并提供了一些参考资料链接。
5万+

被折叠的 条评论
为什么被折叠?



