1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Loading RichTextbox in VB

Discussion in 'Visual Basic ( VB )' started by TheMan, Dec 8, 2010.

  1. TheMan

    TheMan New Member

    Joined:
    Dec 8, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    if you print this--->txtRange.Text what you get?
     

Share This Page