Results 1 to 2 of 2

Thread: RTB = difficult

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    RTB = difficult

    Couldn't find an answer really,

    How can i not lose my formatting when i alter the richtextbox ?


    VB Code:
    1. For i = 1 To Len(strData)
    2.         RichTextBox1.SelStart = Len(RichTextBox1.Text)
    3.         RichTextBox1.SelLength = 0
    4.         If Mid(strData, i, 1) = Chr(2) Then
    5.             'BoldOn = Not BoldOn
    6.             RichTextBox1.SelBold = Not RichTextBox1.SelBold
    7.             'Debug.Print "BOLD " & CStr(BoldOn) & ParseData.strBody
    8.         Else
    9.             RichTextBox1.SelText = Mid(strData, i, 1)
    10.         End If
    11.     Next

    It bolds the correct data, then subsequent data is correctly bolded, whilst the current stuff loses its formatting

    How can i prevent this?

  2. #2

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    nevermind, fixed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width