Results 1 to 4 of 4

Thread: [RESOLVED] RichTextBox color problem

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Dmitri K's Avatar
    Join Date
    Sep 2002
    Location
    West Palm Beach, FL
    Posts
    444

    Resolved [RESOLVED] RichTextBox color problem

    Hey guys,
    i have a large amount of text in my richtextbox (RTB) so I have to use scroll bars. The problem is if I try to highlight any instance of a certain word thruout the whole text, the scroll bars jump around and even tho I return to the original insertion position, the scroll bars could still be offset from original.

    Is there a way to force RTB to not scroll when something out of "visible range" is selected (for example, using txtRTB.Find "mystring" to highlight)?

    Since I couldn't find a solution, I tried to edit the colors directly in the .TextRTF instead, however the following code has no affect and doesn't update the RTB, .TextRTF stays the same

    P.S. .TextRTF has instances of "mystring", I double-checked and RTB's color table is fine also:
    {\colortbl ;\red0\green128\blue0;\red255\green0\blue0;}


    Code:
    RTFStr = .TextRTF
    RTFStr = Replace(RTFStr, "mystring", "\cf1 mystring\cf0 ")
    .TextRTF = RTFStr
    .TextRTF stays the same, all "mystring" are still "mystring", not the wanted "\cf1 mystring\cf0 ", however if i replace "mystring" with "newstring", it does change fine, so it has something to do with changing "\cf#" flags, in this case \cf1 and \cf0; anyone knows how to force the RTB to accept actual RTF code changes?

    Thanks.
    Last edited by Dmitri K; Apr 24th, 2008 at 02:53 PM.

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