Hidden text in rich textbox

How do I hide text in a rich textbox?  My .rtf file created in MS Word contains text formatted as hidden.  When the file is loaded in a rich textbox control, the previously hidden text becomes visible.
Who is Participating?
rantanenConnect With a Mentor Commented:
If you  want, you can do it now. Thank you.
Is all the text to be hidden , or are only specific portions of this text file hidden ?
What I mean is ,  when you load the file in a rich textbox , do you want that none of the text shows up , or only some specific parts ??
Are you loading the file into the textbox only because you want access to the text in it , or are you dong it with a purpose to show some/all of the text to the user as well ?
rzimmerAuthor Commented:
I want to hide only a portion of the text in the rich textbox.  My purpose is to put in some hidden characters that I can search for.  Within these characters would be a numeric "key" that I could use as a help contextid to call popups from my help file.  In other words, click on some text formatted like hypertext links, then search for the key and call the popup.
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Following is a workaround of this problem.

Make the font color of those hidden text parts white or whatever background color you use in your RichTextBox.

The only drawback of this is that you have to make text hidden this way separate lines in order not to create funny looking "holes" in your text. Otherwise works fine.
rzimmerAuthor Commented:
I appreciate ratanen's answer, but I had already thought of it.  I need the text to be on the same line and adjacent to the text I wish to use as Hypertext.
Well, I was pretty sure that was the case. Then the correct answer is: RichTextBox does not support hidden tag.

You have two possibilities IMHO.

Change your design so that your "links" are visible (I guess you don't like that one)

Change your control. There is one I know - ALLText HT/Pro, but it is expensive ($350 ! - not so nice either). Go to


You can download a demo there - (not only expensive, but big - 1.5 MB).

There maybe others, too.

Have you thought changing your help system to HTML-based?

One suggestion: go to


and request for their free CD-set containing demos of almost every control available. Maybe you find something useful there.
rzimmerAuthor Commented:
Thanks rantanen.  I was afraid that was the case.  I bought the AllTextPro control earlier, and it works great, although, as you indicated, it is a bit difficult to work with.  Fortunately, there is a lot of source code, and I have been able to get it to do everything I had planned and more.  I am still holding out hope that there are some API calls that will do the hypertext thing.  I'm sure that's how AllText did it.
OK, I did some digging in MS documentation. In 32-bit windows there is a control called Rich Edit. Version 1.0 is in RICHED32.DLL and Version 2.0 in RICHED20.DLL. Win95 is supplied with version 1.0 and NT 4.0 with both.

RichEditBox is a subset of this.

As you can figure from the name of these controls - DLLs - their usage is not so simple. You start from window creation and handle all messages and all the fun stuff what "real" Windows programming is. But - to this window you can send messages like EM_SETCHARFORMAT, which at least in version 2.0 seems to support HIDDEN property two. (This version 2.0 works also with Win95). I am pretty sure ALLText is based on this control.

You can find documentation for this in Platform SDK, which if I recall correctly, is also available at MSDN Online.
rzimmerAuthor Commented:
Ok, rantanen.  How do I give you the points?  I don't see a way to do it on this page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.