• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1464
  • Last Modified:

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.
0
rzimmer
Asked:
rzimmer
  • 4
  • 4
1 Solution
 
priyamCommented:
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 ?
0
 
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.
0
 
rantanenCommented:
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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.
0
 
rantanenCommented:
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

http://www.bennet-tec.com/

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

http://www.componentsource.com/

and request for their free CD-set containing demos of almost every control available. Maybe you find something useful there.
0
 
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.
0
 
rantanenCommented:
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.
0
 
rzimmerAuthor Commented:
Ok, rantanen.  How do I give you the points?  I don't see a way to do it on this page.
0
 
rantanenCommented:
If you  want, you can do it now. Thank you.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now