RichTextBox Select Method Bug
am 27.03.2006 21:26:03 von AWesner
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.
RE: RichTextBox Select Method Bug
am 27.03.2006 22:02:02 von AWesner
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.
RE: RichTextBox Select Method Bug
am 27.03.2006 23:13:02 von AWesner
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.