Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I hide text in a Rich Text box?

Status
Not open for further replies.

AndyGroom

Programmer
Joined
May 23, 2001
Messages
972
Location
GB
Hi,

Is it possible to hide text in a Rich Text box, is there an RTF code that I could use?

I don't want to make the text colour the same as the backgorund colour or anything corny like that because the text will show up if the user highlights it.

In a way, I need the RTF equivalent of the <!-- --> HTML tag.

- Andy
 
Sadly, although RTF supports a 'hidden' tag (\v), the Rich TextBox control does not support it.
 
Hmm.

But maybe that would do the trick. I want to 'mark' a particular bit of text that I'm pasting via code into the RTF box (eg. to denote the start of a URL that someone might want to insert). All I want is, when the user OK's the text within the RTF box, my program looks for the hidden marker and knows where the URL link begins. I don't actually need to hide any text, just mark it for later.

It doesn't matter if the \v doesn't do anything, just as long as the RTF box doesn't lose it!

Thanks, I'll try an experiment...

- Andy.
 
Yes, that would be nice. But one of the things that the Rich Text box does is to strip out unknown tags...
 
Actually, I just tried \v and it is supported!

If you set the text to be:

This \v is a \v0 test

you see

This test

So, thanks, this is exactly what I wanted. I hope it's not an XP-only phenomenon...
 
Interesting; it sure doesn't work in the VB6 SP5 Rich Text Box control running on NT4 SP6A
 

Does not seem to work with Win2K Pro SP2 VB 6.0 SP5 either.

 
Just to help out a little more, the version of RICHTX32.OCX I am using is 6.00.8804
 
I've got 6.00.8804 too, from Service Pack 5, also of RICHED32.DLL I've got version 5.1.2600

It definitely works for me. Please let me know how you get on, I can't implement this as a feature if it won't work on all platforms!

Would it help if posted an EXE for you to download and try?

- Andy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top