|
-
May 13th, 2010, 02:41 PM
#1
Thread Starter
New Member
[RESOLVED] quick search in a richtextbox
Hi,
I have a RichTextBox where I expect 100 characters per line. Each line can start with the letter A, B, or C. I may have thousands of lines and most of them will start with the letter C.
When the cursor is moved from one line to another and is placed on a "C" line, I need to be able to quickly locate the nearest "B" line above it. It may be hundreds of lines away. A loop to search for the "B" line using GetFirstCharIndexFromLine(x) is too slow.
The user may want to paste many lines into the textbox. If necessary, a mild wait after pasting is acceptable.
Do you have any suggestions for a technique to accomplish what I need to do? Even just a high level suggestion like "use a linked list" would be appreciated.
Thanks.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|