473,395 Members | 1,678 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, finding line #, scrolling to specific line

hi,

my app has two parallel rich text boxes containing the same content in 2
different languages. the lines parallel each other, line #3 in english
contains the same content as line #3 in french.

i need the two boxes to syncronize, if someone scrolls and clicks on line 23
in the english side, it should scroll to line 23 in the french side, and the
same from french to english.

i know that text stored in a rich text box is stored in a string array of
the name rtb.lines.

i need to be able to 1) determine in which line a text was clicked, 2) make
the other box scroll to the same line.

as to 1) the only way i can see doing it is counting the number of crlf's
from the start of the text, which i would prefer not to do because it would
take too long as the text is very long. the other way is to insert some
invisible text in each line indicating the line #, but i don't know how to
make the text invisible (the text without these markers also needs to be
printable). anybody have an idea how to know which line was clicked?

also is there a way to know at least which line is currently at the top of
the control?

as to 2) i can think of counting crlf to match the count of the text clicked
in the other rich text box control, locate the caret there, and use the
ScrollToCaret method, but that works only if the control has the focus, and
the user is clicking in the other rich text box? any idea how to scroll a
rich text box to a certain line?

i can't use the 'Find' method, for though the contents are parallel, the
texts are not.

is there a method to know where the caret is located?

thanks for any help

ray

Nov 21 '05 #1
0 2414

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

Similar topics

14
by: Seth Russell | last post by:
I'm running Kevin Roth's rte box and i want to deactivate the ability to past inside the box. People sometimes paste outrageous things in there that might break my site. How can I deactivate the...
1
by: a_n_d_y_bell | last post by:
Hi- In my application I have a RichTextBox, and I want to scroll it so that the character at a given index appears on the top line of the box. Up till now, I've used this routine, which works...
0
by: Al | last post by:
Hi I like to replace a character at the click of mouse. My main problem is when I click on the characters that need to be changing the richTextBox will scroll up make it very distracting. Is there...
1
by: Adam Honek | last post by:
Hello, In a rich text box with vertical scrollbars how do we get it to show the last item at the bottom should there be lots of text etc? I tried the following but without success: ...
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...
11
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I know I sound like a one-note Johnny on this but I'm still looking for a solution. I need to display characters coming in from a serial port or a socket. I also need to be able to type...
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
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
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
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
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...
0
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
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.