WPF-RichTextBox赋值与取值
取值(字符串):
string str = new TextRange(richtextbox.Document.ContentStart, richtextbox.Document.ContentEnd).Text;
赋值:
// 方式一
string srt="12356457";
Paragraph p=new Paragraph();
p.Inlines.add(new Run(str));
richtextbox.Document.Blocks.Clear();
richtextbox.Document.Blocks.Add(p);
// 方式二
txtMESAPIini.AppendText(srt);
本文来自博客园,作者:꧁执笔小白꧂,转载请注明原文链接:https://www.cnblogs.com/qq2806933146xiaobai/p/16056058.html