Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Loading RichTextbox in VB (http://www.go4expert.com/forums/loading-richtextbox-vb-t24123/)

TheMan 8Dec2010 22:53

Loading RichTextbox in VB
 
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

virxen 10Dec2010 05:54

Re: Loading RichTextbox in VB
 
if you print this--->txtRange.Text what you get?


All times are GMT +5.5. The time now is 10:28.