473,387 Members | 1,669 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,387 software developers and data experts.

how to determine what the select txt is ?

Hi,

I want to be able to show a txt file(stored on disk) to the end user in some
sort of txt editor control, and allow the user to highlight/select words
within the text.

Once they have selected some words or txt I want to be able to have my
application know what line and position the selected text is.

I would figure that I would need either the RTF text control or a third
party txt control. (I can't rely on the user having MS word).

Is there a good txt control I could buy that would have this sort of
functionality ?

Thanks

Jun 27 '08 #1
4 942
On May 13, 4:31 am, "Aussie Rules" <aus...@nospam.comwrote:
Hi,

I want to be able to show a txt file(stored on disk) to the end user in some
sort of txt editor control, and allow the user to highlight/select words
within the text.

Once they have selected some words or txt I want to be able to have my
application know what line and position the selected text is.

I would figure that I would need either the RTF text control or a third
party txt control. (I can't rely on the user having MS word).

Is there a good txt control I could buy that would have this sort of
functionality ?

Thanks
Hi Aussie,
You can do similar thing within your application using RichTextBox's
"SelectionStart" and "SelectionLength" properties. For example, if you
want to highlight a text on richtextbox, i've done this with hoping to
work for you:

' Assuming you have some text in richtextbox placed on a form named
form2
Form2.FindMyText("textToSearch", Form2.RichTextBox1.SelectionStart +
Form2.RichTextBox1.SelectionLength)
Form2.Activate()

Thanks,

Onur Güzel
Jun 27 '08 #2
On May 14, 12:22 pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On May 13, 4:31 am, "Aussie Rules" <aus...@nospam.comwrote:
Hi,
I want to be able to show a txt file(stored on disk) to the end user in some
sort of txt editor control, and allow the user to highlight/select words
within the text.
Once they have selected some words or txt I want to be able to have my
application know what line and position the selected text is.
I would figure that I would need either the RTF text control or a third
party txt control. (I can't rely on the user having MS word).
Is there a good txt control I could buy that would have this sort of
functionality ?
Thanks

Hi Aussie,
You can do similar thing within your application using RichTextBox's
"SelectionStart" and "SelectionLength" properties. For example, if you
want to highlight a text on richtextbox, i've done this with hoping to
work for you:

' Assuming you have some text in richtextbox placed on a form named
form2
Form2.FindMyText("textToSearch", Form2.RichTextBox1.SelectionStart +
Form2.RichTextBox1.SelectionLength)
Form2.Activate()

Thanks,

Onur Güzel
Forgot to mention:
After selecting the text within richtextbox, copy it to clipboard to
be available for any application using;

Clipboard.SetText(Form1.RichTextBox1.SelectedText)

Thanks,

Onur Güzel
Jun 27 '08 #3
Thanks for your replies.

What I am trying to do is not get the selected text, but the position of the
text.

Basiclly I am trying to open a file and have the user select say the
customer ID in the file. That would be say on line 4, position 10 to 15.

I want to be able to know the location, so that more files of the same
format can be then processed and have the customer ID extracted based onthe
location.

Hope that make sense

Again, thanks for your replies.

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:40**********************************@c58g2000 hsc.googlegroups.com...
On May 14, 12:22 pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On May 13, 4:31 am, "Aussie Rules" <aus...@nospam.comwrote:
Hi,
I want to be able to show a txt file(stored on disk) to the end user in
some
sort of txt editor control, and allow the user to highlight/select words
within the text.
Once they have selected some words or txt I want to be able to have my
application know what line and position the selected text is.
I would figure that I would need either the RTF text control or a third
party txt control. (I can't rely on the user having MS word).
Is there a good txt control I could buy that would have this sort of
functionality ?
Thanks

Hi Aussie,
You can do similar thing within your application using RichTextBox's
"SelectionStart" and "SelectionLength" properties. For example, if you
want to highlight a text on richtextbox, i've done this with hoping to
work for you:

' Assuming you have some text in richtextbox placed on a form named
form2
Form2.FindMyText("textToSearch", Form2.RichTextBox1.SelectionStart +
Form2.RichTextBox1.SelectionLength)
Form2.Activate()

Thanks,

Onur Güzel
Forgot to mention:
After selecting the text within richtextbox, copy it to clipboard to
be available for any application using;

Clipboard.SetText(Form1.RichTextBox1.SelectedText)

Thanks,

Onur Güzel

Jun 27 '08 #4
>
What I am trying to do is not get the selected text, but the position of
the text.
If the text is in a textbox you can use SelectionStart and SelectionLength.
Jun 27 '08 #5

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

Similar topics

1
by: John Sway | last post by:
I'm writing a web-based "Query analyser" tool for our company intranet. It allows a user to type any SQL statement in a form, and execute it over the Web. The SQL can be a query that returns...
5
by: bart plessers | last post by:
Hello, Currently I am developping a internet "directory browser" My page 'default.asp' has following entries: CurrentPATH = Request("MyLink") Set oFSO =...
5
by: Hennie de Nooijer | last post by:
Hi, This is a diffcult issue to explain. I hope to make my problem clear to you. SITUATION I'm building A SLA Query for a customer. This customer has an awkward way to determine the SLA results...
8
by: John Grenier | last post by:
Hi, I have to determine the "standing" (WIN - TIE - LOSS) from confrontations between two teams on a contest. The table matchResults has fields cont_id, team_id and contest_result (int). ...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
4
by: laurenq uantrell | last post by:
I am trying to determine which of three stored procedure designs are fastest in the Query Analyzer: One query is a straight SELECT query with all desired rows and a dozen (tblName.RowName =...
2
by: Hunter Hillegas | last post by:
I cannot determine what character is stored in a varchar... For instance: thedonnaholics=# select state from mailing_list where rec_num = 7; state ------- (1 row) If I then execute:
15
by: Robby Russell | last post by:
I am trying to track down a method of determining what a sequence name is for a SERIAL is in postgresql. For example, CREATE TABLE foo (id SERIAL PRIMARY KEY NOT NULL, bar TEXT); \d foo...
6
by: Jana | last post by:
Greetings Access Gurus! I am working on an app to send batch transactions to our bank, and the bank requires that we place an effective date on our files that is 'one business day in the future,...
2
by: tks423 | last post by:
How can I determine the values of a listbox, both unselected or selected after submitting the form: Code: <select name="sel1" size="10" multiple="multiple"> <? PHP code populates listbox ?>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.