473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
2 2856
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1636
by: Brian Scott | last post by:
I am currently trying to control the syntax highlighting of a richtextbox control whilst the user types. At the moment I have implemented a thread which calls the richTextBox.Invoke on a method...
1
1042
by: Tim Smith | last post by:
Hi I have a richtextbox and I want the users to be able to search for text within the control. I would think that the richtextbox.find() would work, but I can't figure out how to get the textbox...
2
17260
by: JonnyT | last post by:
I searched high and low for an answer on how to auto scroll a richtextbox and now I finally have it. Since it took me a while to get a good efficient way of doing it that didn't require focus to...
0
1685
by: Eric Borden | last post by:
I'm not sure how to get this question to someone at MS but I think I found an issue with the RichTextBox Control used in VS C# .NET 2.0 (I use express). The problem is if there is hidden text at...
1
3038
by: Leon Friesema | last post by:
Hi, I'm working on a RichTextBox with some "in-program" style-features (e.g. *no way* becomes bold : like MS Word does). Got everything working fine, flickerfree and reasonable fast, but in...
9
4835
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
3
7147
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
8
2573
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have created a Control that extends RichTextBox to do syntax-hilighting. My strategy is to have a timer that restarts every time a user types a key so that it can wait until the user pauses for...
5
6054
by: Andrus | last post by:
I use Winforms RichTextBox control to edit scripts. Scripts are plain ascii texts. When error occurs, script engine returns character position of error in code as integer. How to position...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.