2006. augusztus 13., vasárnap

How to make a TMemo show the chosen line


Problem/Question/Abstract:

How can I have a memo show a chosen line? In fact my program does some work and puts information in a memo, I would like the last line of the memo to be always visible. I tried MyMemo.ScrollBy(0, MaxInt), but that does not work.

Answer:

with Memo1 do
begin
  SelLength := 0;
  SelStart := Perform(EM_LINEINDEX, LineNo, 0);
  Perform(EM_SCROLLCARET, 0, 0);
end;

LineNo hold the line number you want to scroll to.

Nincsenek megjegyzések:

Megjegyzés küldése