473,626 Members | 3,305 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2438

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

Similar topics

14
2816
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 ability to paste? see: http://www.kevinroth.com/rte/demo.htm Thanks for your help Seth Russell
1
5630
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 fine: == rtb.Focus(); rtb.SelectionStart=rtb.Text.Length-1; rtb.SelectionLength=0; rtb.SelectionStart=rtb.Text.IndexOf("MY_TEXT");
0
1731
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 anyway that I can disable scrolling? Here is what the simple code aRichtext.Text = aRichtext.Text.Remove(position, 1) aRichtext.Text = aRichtext.Text.Insert(position, "N") aRichtext.Select(position, 1)
1
2997
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: xxx.ScrollBars.Vertical.Equals(boxUserTextDisplay.ScrollBars.Vertical - 1) Thanks,
2
3091
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 color of the text will depend upon the first argument and the text will be contained in the second argumet. As far as I know, my application is not multithreaded - at least I don't knowingly start any other threads. Since I don't know what the heck...
4
5461
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 in versions 3.0 or later of the class. However, also just found out that the new Rich Text property in Access 2007 ALSO does not support full text justification! This seems incredible, that MS would create a brand new application, and not...
16
11060
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 know one way or the other whether that was true or not, or could point me to an article or help text that would. What I have seen so far online and in Access 2007 help seems to confirm the above. But that (or at least (b)) seems incredible that it...
11
7609
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 characters into the display myself - but that's not the main issue at this time. I've tried a scrolling multiline text box but once the original viewable area fills up and it starts scrolling the flashing of the entire area drives me nuts. The...
0
8262
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8701
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7192
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
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 we have to send another system
1
1807
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.