You can do something like :
Point pt = richTextBox1.GetPositionFromCharIndex(richTextBox1.SelectionStart);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Try to implement some object in richtextbox selected text centered top of the selected line(s);
Let me demostrate with an example.
" The dog was come and go "
this is the sample sentence. with mouse or with keyboard the users select the " dog was come " and the cursor is positioned after the letter of " e| ".
what i try to get , the blinking cursor position but based on the object ( in this case the object is richtextbox ) , but getting the position of the cursor as X,Y Cordinates instead of getting a index.
(0,0)
------y|
--------| >|<
--------|
--------|--------x
--------|
--------|
--------|
this cordinates of the richtext box showed at above also the cursor is >|< mark like this , how can i get the X,Y cordinates from Richtextbox.
Thanks.
You can do something like :
Point pt = richTextBox1.GetPositionFromCharIndex(richTextBox1.SelectionStart);