TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kae Vee
NA
3
3.8k
How to get the current offset position in Rich text box
Nov 12 2018 5:01 AM
While am going edit mode in Richtext box by double click, the caret position goes either to start or to the end of the text. But in normal text box wherever you double click, the cusrsor in the correct position.
How to change the caret position based on mouse clicking position? here i provided the code what i have tried.
I want to get excel like behavior.
TextPointer tp = richtextbox.CaretPosition;
tp = tp.GetNextInsertionPosition(LogicalDirection.Forward);
richtextbox.Selection.Select(richtextbox.CaretPosition, tp);
TextPointer start = richtextbox.Document.ContentStart;
TextPointer caret = richtextbox.CaretPosition;
TextRange range = new TextRange(start, caret);
int indexInText = range.Text.Length;
I have double clicked near "3" in "12345" highlighted as yellow in snapshot. But the caret blinks at the start position.
Reply
Answers (
0
)
wpf navigate from page to window
Dispatcher timer Freeze issue