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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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.
If you  want, you can do it now. Thank you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.