Loading RichTextbox in VB

TheMan's Avatar, Join Date: Dec 2010
Newbie Member
Hi,

I am Currently trying to load my RichTextbox with "notes" which is passed up as a byte array from the database to this code. For some reason the array makes it all the way here but it only puts a space in the richtextbox. Am i missing somthing or doing something wrong?

VB CODE
Code:
Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()

                Dim txtRange As TextRange = New TextRange(RichTextBoxNotes.Document.ContentStart,
                                                     RichTextBoxNotes.Document.ContentEnd)
                txtRange.Save(memoryStream, System.Windows.DataFormats.Rtf)
                Dim byteArray(objCall.Notes.Length - 1) As Byte
                byteArray = memoryStream.ToArray()
                txtRange.Load(New System.IO.MemoryStream(byteArray), DataFormats.Rtf)
                RichTextBoxNotes.DataContext = txtRange.Text
Thanks
0
virxen's Avatar, Join Date: Nov 2009
Pro contributor
if you print this--->txtRange.Text what you get?