Showing Database rtf data in richtextbox

2019-09-02 07:04发布

问题:

I write WPF application. In this application user copy data from the word document and add it to richtextbox. Then I save this data in sqlite database. But when I get xaml data from data base and do following procedure

// Saving data
StringWriter wr = new StringWriter();
XamlWriter.Save(RichTextBox.Document, wr);

and

FlowDocument doc = XamlReader.Parse(*wrStringValuefromDB*) as FlowDocument;

End of this process richtextbox concatenate some words as follow:

I can't understand what is happening here, Please help me.

Now I know that this problem happens some PC or OS. For example, I install application on Windows 8, Windows 8.1, Windows 10 and it work very good. But some PC doesn't. For example:

回答1:

See ... stackoverflow.com/questions/829053/… Maybe this is your problem!? Allthough it's called TextRange() it is formatted Text.