473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Rich Text box question

Hi,

I guess I am not understanding something and I have been searching Help in
VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed
from a Tree View and based on this selection, the appropriate rtf file is
opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text. I
know enough to use rtf.find(), but this returns an integer and from there I
do not know where to go.

The next thing I want to do is have the capability to find all files that
contain the specific keyword. I would imagine that I have to open each file
(one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad
Nov 20 '05 #1
6 939
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in
VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed
from a Tree View and based on this selection, the appropriate rtf file is
opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text. I know enough to use rtf.find(), but this returns an integer and from there I do not know where to go.

The next thing I want to do is have the capability to find all files that
contain the specific keyword. I would imagine that I have to open each file (one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad

Nov 20 '05 #2
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in
VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed
from a Tree View and based on this selection, the appropriate rtf file is
opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text. I know enough to use rtf.find(), but this returns an integer and from there I do not know where to go.

The next thing I want to do is have the capability to find all files that
contain the specific keyword. I would imagine that I have to open each file (one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad

Nov 20 '05 #3
I am getting the index of each occurence of the string that is found, but I am still unsure as to how to set the selection start point. I am even arbitrarily setting a high integer as a faux starting point and the running the ScrolltoCaret method:

rtbView.SelectionStart = 5000
rtbView.ScrollToCaret()

This is still not doing anything. Any help will be appreciated.

Brad

"Juan Romero" <ju*********@bowne.com> wrote in message news:OS**************@TK2MSFTNGP12.phx.gbl...
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in
VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed
from a Tree View and based on this selection, the appropriate rtf file is
opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text.

I
know enough to use rtf.find(), but this returns an integer and from there

I
do not know where to go.

The next thing I want to do is have the capability to find all files that
contain the specific keyword. I would imagine that I have to open each

file
(one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad


Nov 20 '05 #4
I am getting the index of each occurence of the string that is found, but I am still unsure as to how to set the selection start point. I am even arbitrarily setting a high integer as a faux starting point and the running the ScrolltoCaret method:

rtbView.SelectionStart = 5000
rtbView.ScrollToCaret()

This is still not doing anything. Any help will be appreciated.

Brad

"Juan Romero" <ju*********@bowne.com> wrote in message news:OS**************@TK2MSFTNGP12.phx.gbl...
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in
VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed
from a Tree View and based on this selection, the appropriate rtf file is
opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text.

I
know enough to use rtf.find(), but this returns an integer and from there

I
do not know where to go.

The next thing I want to do is have the capability to find all files that
contain the specific keyword. I would imagine that I have to open each

file
(one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad


Nov 20 '05 #5
He he he,

As I was reading your postback, I was trying to remember, since I knew I had
come to this problem too....
Well, here is the answer, all you need to do is call:

rtb1.find("mysearchstring")

BUT! (here is the trick...)

Give the Richtextbox control the focus after that, and it will magically
highlight the word....

rtb1.focus()

Why it behaves this way? who knows...

"Brad Allison" <tr*******@sbcglobal.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am getting the index of each occurence of the string that is found, but I
am still unsure as to how to set the selection start point. I am even
arbitrarily setting a high integer as a faux starting point and the running
the ScrolltoCaret method:

rtbView.SelectionStart = 5000
rtbView.ScrollToCaret()
This is still not doing anything. Any help will be appreciated.
Brad
"Juan Romero" <ju*********@bowne.com> wrote in message
news:OS**************@TK2MSFTNGP12.phx.gbl...
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed from a Tree View and based on this selection, the appropriate rtf file is opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text.
I
know enough to use rtf.find(), but this returns an integer and from
there I
do not know where to go.

The next thing I want to do is have the capability to find all files

that contain the specific keyword. I would imagine that I have to open each

file
(one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad


Nov 20 '05 #6
He he he,

As I was reading your postback, I was trying to remember, since I knew I had
come to this problem too....
Well, here is the answer, all you need to do is call:

rtb1.find("mysearchstring")

BUT! (here is the trick...)

Give the Richtextbox control the focus after that, and it will magically
highlight the word....

rtb1.focus()

Why it behaves this way? who knows...

"Brad Allison" <tr*******@sbcglobal.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am getting the index of each occurence of the string that is found, but I
am still unsure as to how to set the selection start point. I am even
arbitrarily setting a high integer as a faux starting point and the running
the ScrolltoCaret method:

rtbView.SelectionStart = 5000
rtbView.ScrollToCaret()
This is still not doing anything. Any help will be appreciated.
Brad
"Juan Romero" <ju*********@bowne.com> wrote in message
news:OS**************@TK2MSFTNGP12.phx.gbl...
I am just talking out of my head here, but If I remember well, the Find
Function returns the integer corresponding to the index of the first
character of the search match, so what you want to do is set the selection
start point to that index, call the ScrollToCaret [or something like that]
method to make the box scroll to the item found, then select or highlight
the whole word (which goes beyond the scope of this explanation).

Good Luck!

"Brad Allison" <ba******@ukcdogs.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Hi,

I guess I am not understanding something and I have been searching Help in VB, newgroups, etc.

I have a simple application that contains just over 300 rich text files
(these are breed standards for purebred dogs). The user selects the breed from a Tree View and based on this selection, the appropriate rtf file is opened in a different form containing the rich text box control. All of
this works so here comes my dilemma...

I want to user to have the capality to search the opened file using a
keyword or words and the rtf to highlight and go right to the found text.
I
know enough to use rtf.find(), but this returns an integer and from
there I
do not know where to go.

The next thing I want to do is have the capability to find all files

that contain the specific keyword. I would imagine that I have to open each

file
(one at a time) into a streamreader and do a search from there. If the
keyword is found then I can add that file to a listbox.

Thank you for any useful information.

Brad


Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom_ZC | last post by:
I'm writing a find and replace routine for a text editor I'm working on. The editor has a rich text box on the main form (frmMain). The find/replace form is modeled after the one in Word '97/2K. ...
3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
1
by: PC User | last post by:
I found this Rich Text Editor and I've been trying to recreate it in my own application. I've had trouble with the COMCTL.ImageListCtrl and the COMCTL.Toolbar to recreate the toolbar. And I've...
2
by: VB Programmer | last post by:
I want to create an email message with a HTML body and email it out. I know how to create/send the email (for the most part.) 1. Any ideas or examples of using an ASP.NET rich text editor so...
6
by: Brad Allison | last post by:
Hi, I guess I am not understanding something and I have been searching Help in VB, newgroups, etc. I have a simple application that contains just over 300 rich text files (these are breed...
1
by: tomi.trescak | last post by:
Hi I have a problem with storing rich text in MySQL. I store rich text in MySQL (in column with type "text") which i get from Rich Textbox control. When i do reverse processing by trying to...
7
by: Prasad | last post by:
Hi all, I am trying to develop a simple rich text editor I do only require bold, itlaic, underline.. The code for IE is <script> function displayEditor(editor, html, width, height) { ...
2
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, Sorry for the long-winded dissertation - but, I have an application where I need to write text to a rich text box using a common method, callable from anywhere in my application. The...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.