>>Hello Everybody
>>
>>does anyone know how to bring the insertion cursor (caret) to where the mouse right-clicked in the RTFControl ActiveX?
>>
>>please tell me if i am wrong, but that is supposed to be correct GUI - right?
>>
>>thanks for all your help
>
>
>Update:
>I have in the MouseUp() of the Active:
>IF BUTTON = 2
> * *** the right mouse button was clicked
>ENDIF
>but after this, the cursor stays were it was before the click, and does not get moved to where the mouse is.
>
>i was thinking to update .SelStart to the new position, but how do i find out where that new position is? the Mouse position doesn't realy help, since its not relflected as the number of characters in the rtf-control.
Hi Gunnar,
I don't have the VFP code for this. But I think this is not difficult. Here is the hint:
- Get the mouse position ( GetCursorPos() API )
- Convert to the client window, which is RTF control ( ScreenToClient )
- Send EM_CHARFROMPOS message
- Send EM_SETSEL message with the return value from EM_CHARFROMPOS
HTH
Herman