Solved

Hidden text in rich textbox

Posted on 1997-12-10
9
1,353 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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
 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 54
How to create a duplicate finder Application 9 121
Advice in Xamarin 21 79
Copy a range from 1..n excel sheets to one destination sheet 2 31
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 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