...follow the mouse in TMemo to set the cursor position?

Author: Rainer K├╝mmerle
Homepage: http://www.thinklazy.de

Category: VCL

procedure TForm1.Memo1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  
Memo1.SelStart  := LoWord(SendMessage(Memo1.Handle, EM_CHARFROMPOS, 0, MakeLParam(X, Y)));
  Memo1.SelLength := 0;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base