RichTextBox Cursor Position

G

GSX

I've been reading and searching (and searching and reading) for far too
many hours. I'm rather new - so I apologize if this is an over asked
question...

I'm working on a small text editor as a learning project using the
RichTextBox control. I wish to display the current line and total line
count on the status bar, and also the cursor position on the current line.

I have found the current line by using
RichTextBox1.GetLineFromCharIndex(TextBox1.SelectionStart)

However, I can't for the life of me figure out a way to get the cursor
position on that line. I tried RichTextBox1.SelectionStart but that
shows the position from the start of the document, not the active line.

Any ideas or links that I could check out?

Thanks in advance!!
 
H

Herfried K. Wagner [MVP]

* GSX said:
Thank you my friend, I'm off to experiment!!!!!

If you have any further questions (maybe in converting the code to
VB.NET), feel free to ask them here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top