Scrolling a Memo by 5 lines using code
Posted on 1997-08-31
I want to scroll a memo component to a particular line, say, line 5 -
and when I try
I get the text scrolling (but not by a complete line - so I get a blur
effect). Obviously I need to replace the 10 by the font height in
pixels (multiplied by the number of lines to scroll by).
But the problem seems deeper - when I do a
the effect of the scroll goes away viz. the scroll has not 'really'
happened - it is just a visual illusion.
I obviously need to send a EM_ message of some sort, and found the
following routine which I experimentally HACKED:
procedure ScrollMemoToTop(Memo: TCustomMemo);
topLine : integer;
topLine := SendMessage(Memo.Handle, EM_GETFIRSTVISIBLELINE,
// Experimentally override with the line to scroll to
topLine := 5;
But this doesn't seem to actually do anything. Can anyone help me out
here? I just want to be able to simply say