Move Caret Position - TAdvRichEditor

Hello TMS!


Version: 1.6.5.0

I am trying to get the "word under mouse" when I click the right mouse button. However it doesn't work unless I left click first, then right click. Is there a way to set the caret position via the right mouse button please? What I am trying to accomplish is to decide whether I should show a popupmenu or not (which works fine if I left click before right clicking).

Thank you,
Mick.

You can do this simply with:


procedure TForm1.AdvRichEditor1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if button = mbRight then
    advricheditor1.SelectWordAtXY(x,y);
end;

Thank you,


I cannot believe I missed this. 

Cheers,
Mick.