mathematics
asked on
the position of the cursor in TRichEdit
How can we get the position of the cursor in TRichEdit?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can get the cursor position using CaretPos:
RichEdit1.CaretPos.X // zero based char number in the line
RichEdit1.CaretPos.Y // zero based line number
To get the absolute caret position use SelStart property
CharIndex := RichEdit1.SelStart;
RichEdit1.CaretPos.X // zero based char number in the line
RichEdit1.CaretPos.Y // zero based line number
To get the absolute caret position use SelStart property
CharIndex := RichEdit1.SelStart;
hi kotik,
must be a d4 feature, i've d3 and there is no caretpos!
well, mathematics, if you use d4, then u can use kotiks suggestion, because it seems to me easier to implement. in this case reject my answer.
meikl
must be a d4 feature, i've d3 and there is no caretpos!
well, mathematics, if you use d4, then u can use kotiks suggestion, because it seems to me easier to implement. in this case reject my answer.
meikl
ASKER
meikl,Thanks. Maybe RichEdit1.CaretPos.X is the pixels (X,Y).
I will try.
I will try.
what does you mean?
the coordinates?
the Line?
the charindex?
which position?
meikl