1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| Procedure GetMemoLinePos(Memo:TMemo;var MemoRow,MemoCol:Integer); Begin With Memo do Begin MemoRow := SendMessage(Handle,EM_LINEFROMCHAR,SelStart,0); MemoCol := SelStart - SendMessage(Handle,EM_LINEINDEX,MemoRow,0); End; End;
Procedure SetMemoLinePos(Memo:TMemo;MemoRow,MemoCol:Integer ); Begin If MemoRow <= Memo.Lines.Count Then Memo.SelStart := SendMessage(Memo.Handle,EM_LINEINDEX,MemoRow,0) + MemoCol Else Memo.SelStart := SendMessage(Memo.Handle,EM_LINEINDEX,Memo.Lines.Count,0) + MemoCol End; |