嗨,我在显示或将我的 Richtextbox 中的数据传输到其他 Richtextbox 时遇到问题...
richtextbox1.Document = richtextbox2.Document; //This will be the idea..
实际上我打算做的是,我想将我的数据从我的数据库传输到我的列表视图,它将显示为它是什么
SQLDataEHRemarks = myData["remarks"].ToString();// Here is my field from my database which is set as Memo
RichTextBox NewRichtextBox = new RichTextBox();// Now i created a new Richtextbox for me to take the data from SQLDataEHRemarks...
NewRichtextBox.Document.Blocks.Clear();// Clearing
TextRange tr2 = new TextRange(NewRichtextBox.Document.ContentStart, NewRichtextBox.Document.ContentEnd);// I found this code from other forum and helps me a lot by loading data from the database....
MemoryStream ms2 = GetMemoryStreamFromString(SQLDataEHRemarks);//This will Convert to String
tr2.Load(ms2, DataFormats.Rtf);//then Load the Data to my NewRichtextbox
现在我想要做的是,我将把这些数据加载到我的 ListView.. 或其他控件,如文本块或文本框......
_EmpHistoryDataCollection.Add(new EmployeeHistoryObject{
EHTrackNum = tr2.ToString() // The problem here is it will display only the first line of the paragraph.. not the whole paragraph
});