Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27469

Suggestions please. Processing data in a RichTextBox

$
0
0
I have a rich text box containing lines of data.

My program needs to process each line of text. (Change Language of certain words)

I do not bother checking lines that are not visible - I only check lines that are visible. To the user it appears that the whole document has been done but in fact I'm updating lines as they come into view. All very smooth.

All of the above is working fine so I don't need any advise on the above.

But, if the user scrolls up and back down again I'm wasting processing power re-doing lines that have already been done. So, what I'm looking for is some way to know which lines have been processed and not bother doing them again.

The textbox is an array of lines so having an array of booleans the same size and as each line is processed then I set the corresponding boolean to true so if that lines comes in to view again I don't need to check that line. I suppose that would work but what if lines are inserted or deleted. To allow dynamically adding/removing elements from the middle of my array I could use a list instead.

But other problesm come to mind. What if a number of lines are inserted. I'd need to notice the rtb linecount and workout which are the new lines and insert that many elements into my list. But what if 5 lines were pasted in/overwritten. The Linecount didn't change but I need to know which lines are new so that I can flag them for doing.

Does anyone have any suggestions ? I'm not looking for somebody to code this for me. Just looking for pointers, maybe there's a property of the rtb that I'm missed.

Thanks

Viewing all articles
Browse latest Browse all 27469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>