467,923 Members | 1,431 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

RichTextBox Select Method Bug

I am currently working to create a VB program that will do more detailed
in-file text search functions than windows has to offer. I have a form with a
RichTextBox control to display the text that has been found in the files. The
problem is that when a search has been found that is at the very start of the
file and the .select method is used to select just the first portion it ends
up selecting everything in the RichTextBox control regardless of the
end-selection index. This behavior does not happen if the selected text is
anywhere else in the RichTextBox control. Has anyone else observed this bug?

Also I could avoid using the RichTextBox control methods to format my search
finds if I could format them in my array before loading them into the
control. Could anyone give me a suggestion as to how to do this? My array
holds only text and not formats and I'm not sure how the best way would be to
mark portions of the text for reformatting on or before load. The formatting
of the text helps the user identify where a search string has been found in
the file and I don't want to permanently keep the format changes. Perhaps I'm
going about this in the wrong direction. Any suggestions would be helpful.
Thanks in advance.
Mar 27 '06 #1
  • viewed: 2620
Share:
2 Replies
It must be something I'm doing wrong because I created another simple program
to recreate the bug and it's not coming up. I'm using the same numbers
though. Let me do more research and figure out why it's not happening now.
Still any suggestions on showing format would be appreciated.

"AWesner" wrote:
I am currently working to create a VB program that will do more detailed
in-file text search functions than windows has to offer. I have a form with a
RichTextBox control to display the text that has been found in the files. The
problem is that when a search has been found that is at the very start of the
file and the .select method is used to select just the first portion it ends
up selecting everything in the RichTextBox control regardless of the
end-selection index. This behavior does not happen if the selected text is
anywhere else in the RichTextBox control. Has anyone else observed this bug?

Also I could avoid using the RichTextBox control methods to format my search
finds if I could format them in my array before loading them into the
control. Could anyone give me a suggestion as to how to do this? My array
holds only text and not formats and I'm not sure how the best way would be to
mark portions of the text for reformatting on or before load. The formatting
of the text helps the user identify where a search string has been found in
the file and I don't want to permanently keep the format changes. Perhaps I'm
going about this in the wrong direction. Any suggestions would be helpful.
Thanks in advance.

Mar 27 '06 #2
I found the problem and it was my own fault. sorry about that. This post can
be deleted.

"AWesner" wrote:
It must be something I'm doing wrong because I created another simple program
to recreate the bug and it's not coming up. I'm using the same numbers
though. Let me do more research and figure out why it's not happening now.
Still any suggestions on showing format would be appreciated.

"AWesner" wrote:
I am currently working to create a VB program that will do more detailed
in-file text search functions than windows has to offer. I have a form with a
RichTextBox control to display the text that has been found in the files. The
problem is that when a search has been found that is at the very start of the
file and the .select method is used to select just the first portion it ends
up selecting everything in the RichTextBox control regardless of the
end-selection index. This behavior does not happen if the selected text is
anywhere else in the RichTextBox control. Has anyone else observed this bug?

Also I could avoid using the RichTextBox control methods to format my search
finds if I could format them in my array before loading them into the
control. Could anyone give me a suggestion as to how to do this? My array
holds only text and not formats and I'm not sure how the best way would be to
mark portions of the text for reformatting on or before load. The formatting
of the text helps the user identify where a search string has been found in
the file and I don't want to permanently keep the format changes. Perhaps I'm
going about this in the wrong direction. Any suggestions would be helpful.
Thanks in advance.

Mar 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Brian Scott | last post: by
1 post views Thread by Tim Smith | last post: by
reply views Thread by Eric Borden | last post: by
1 post views Thread by Leon Friesema | last post: by
9 posts views Thread by James Wong | last post: by
3 posts views Thread by michael sorens | last post: by
8 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.