In a .NET 3.5 application, i want to get caret position in a RichTextBox control. The RTB is not XAML. Also, the RTB doesn’t have CaretPosition property as described here:
http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.caretposition.aspx
What is the simplest way using which i can get the caret position?
EDIT:
To be more specific i want to find out what is the position of the caret from the start of the line on which it is positioned. I can get the line number by using GetLineFromCharIndex(rtb.SelectionStart) but not the offset from the start of the line.
To get the position of the caret from the start of the current line I will try this: