Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.basic.visual.misc > #513
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Newsgroups | comp.lang.basic.visual.misc |
| Subject | Re: RichEdit control question |
| Date | 2011-10-19 10:09 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <j7mlet$r6v$1@dont-email.me> (permalink) |
| References | (8 earlier) <j7ibsd$eps$1@dont-email.me> <j7if8n$71l$1@dont-email.me> <j7iheb$455$1@speranza.aioe.org> <j7ishj$bnc$1@dont-email.me> <j7k2n1$492$1@dont-email.me> |
| I'll just have to keep looking. Maybe I will have to simply do | search/replace of rtf tags. But it takes a long time.... | I did a test to see whether <34556> would be recognized as a word, with the idea that you could do something like: (aircode here) LSt = 0 Do i2 = RTB.Find(LSt, "<") i2 = i2 + 1 RTB.SelStart = i2 SendMessageAny hRTB, EM_SETCHARFORMAT, SCF_SELECTION Or SCF_WORD, CF2 LSt = i2 Loop SCF_WORD is supposed to hide the word where SelStart is, but it didn't recognize <###> as a word. So.... You could just maintain a numeric record of offset and length of each hidden text section, but that would have to update for each change in the RTB. In my experience it's by far the fastest and easiest to tokenize the RTF text. We had a long, involved discussion of this topic some years ago. At the time I put together a test project. If you know VB6 and have a way to load a VB6 project you might find the code useful: http://www.jsware.net/jsware/test/rtbtest.zip The sample does something like what you want, except that it's identifying text to be colored rather than text to be hidden. But the basic operation is the same. It tokenizes the text string by pointing an integer array at it and treating the characters as numbers. It rebuilds a new string bit by bit using the VB Mid statement, which seems to be essentially a way to input text into an array. In other words, it works extremely fast by avoiding string allocation operations. If you can use a similar approach in VB.Net then once you've set up the tokenizing routine you have a great deal of adaptibility. Hiding or unhiding text becomes very fast and simple, by looking for < and then >, and then adding or not adding the visibility marker. Then adding anything else, like coloring, bold, italic, edits, etc. becomes just a simple addition to the tokenizer routine, with the complexity of the tokenizer having very little effect on overall speed.
Back to comp.lang.basic.visual.misc | Previous | Next — Previous in thread | Next in thread | Find similar
RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-10 14:41 -0700
Re: RichEdit control question "Nobody" <nobody@nobody.com> - 2011-10-11 00:53 -0400
Re: RichEdit control question BTIS Jeff <btisjb@gmail.com> - 2011-10-11 08:17 -0700
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:17 -0700
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-11 22:27 +0100
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:59 -0700
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-12 08:00 +0100
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-12 16:18 -0700
Re: RichEdit control question Deanna Earley <dee.earley@icode.co.uk> - 2011-10-13 08:45 +0100
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 10:24 +0100
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 11:41 +0100
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 13:30 +0100
Re: RichEdit control question Eric Coleman <eric@strategon.com> - 2011-10-13 19:55 -0500
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-14 09:30 +0100
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 07:53 -0700
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-15 17:03 +0100
Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:25 -0500
Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:29 -0500
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 12:45 -0700
Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 15:24 -0500
Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-15 23:16 +0000
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-16 18:21 -0700
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 23:15 -0400
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 17:19 -0400
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 15:59 -0700
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 19:59 -0400
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 17:34 -0700
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 23:46 -0400
Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-18 07:35 -0700
Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-18 15:17 +0000
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-19 10:09 -0400
Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-19 18:26 +0100
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-15 19:53 -0400
Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 03:32 +0000
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 12:02 -0400
Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 22:10 +0000
Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 19:17 -0400
Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-17 09:43 +0000
csiph-web