Reputation: 3711
How to get coordinates of certain character within TextBox and/or RichTextBox?
I will try to explain this through function:
Point GetXY(int characterIndex) {
//do some magic
return new Point(x, y);
}
Idea is to find where selected text is located so Find dialog will not be displayed over this location but moved to side (like Word is doing).
Upvotes: 5
Views: 3775
Reputation: 8938
GetPostitionFromCharIndex might be what you are looking for.
Upvotes: 5
Reputation: 34138
You can do this by using interop to SendMessage an EM_POSFROMCHAR message.
Upvotes: 1