Solved

Hidden text in rich textbox

Posted on 1997-12-10
9
1,343 Views
Last Modified: 2008-02-01
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
Comment
Question by:rzimmer
  • 4
  • 4
9 Comments
 

Expert Comment

by:priyam
ID: 1444595
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
 

Author Comment

by:rzimmer
ID: 1444596
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
 
LVL 4

Expert Comment

by:rantanen
ID: 1444597
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
 

Author Comment

by:rzimmer
ID: 1444598
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Expert Comment

by:rantanen
ID: 1444599
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
 

Author Comment

by:rzimmer
ID: 1444600
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
 
LVL 4

Expert Comment

by:rantanen
ID: 1444601
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
 

Author Comment

by:rzimmer
ID: 1444602
Ok, rantanen.  How do I give you the points?  I don't see a way to do it on this page.
0
 
LVL 4

Accepted Solution

by:
rantanen earned 100 total points
ID: 1444603
If you  want, you can do it now. Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now