Share via

CRichEDitCTrl-CharFromPos is not working properly

abc abc 351 Reputation points
2020-09-24T07:38:07.947+00:00

Hi,

I subclassed the cricheditctrl, I have text abcde. In onmousemove, if I put mouse pointer over c charfrompos returns 2;
If I move mouse pointer below c vertically(that is x coordinate is not changed y coordinate is changed) I am getting the same index 2 eventhough there is no character available where I am moving mouse pointer.

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


1 answer

Sort by: Most helpful
  1. Castorix31 91,876 Reputation points
    2020-09-24T08:57:26.89+00:00

    See the doc :

    Rich edit controls: The return value specifies the zero-based character index of the character nearest the specified point. The return value indicates the last character in the edit control if the specified point is beyond the last character in the control.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.