Как переместить каретку TMemo в нужную строку?

Материал из DRKB

Как переместить каретку TMemo в нужную строку?[править | править код]

function SetCaretPosition(memo: TMemo; x, y: Integer);
var
  i: Integer;
begin
  i := SendMessage(memo.Handle, EM_LINEINDEX, y, 0) + x;
  SendMessage(memo.Handle, EM_SETSEL, i, i);
end;

или

type
  TFake = class(TCustomMemo);

implementation

TFake(MyMemo).SetCaretPos();


Author: Vit (www.delphist.com, www.drkb.ru, www.unihighlighter.com, www.nevzorov.org)
Source: Взято с Vingrad.ru http://forum.vingrad.ru
ID: 00546