I have posted a reply to an old thread (
http://forum.lazarus.freepascal.org/index.php/topic,9643.0.html) which is related to my problem, but the area where that thread was initially posted is not correct, so I repost my question here.
On a long memo (of type TMemo) which has more data that can fit on its viewable area, when the vertical scroll bar is at the top position (that is, at the top of the memo's display area you see its first line) and you make something like
Memo.SelText:='blabla'; there is no problem. If you make the same when the scroll bar is not at the top, the scroll bar moves to the top regardless of the position of the
SelStart point, which in some cases moves out of the scope.
If you use a workaround like
Memo.SelStart:=Memo.SelStart; the scrollbar still tries to move to the top, but
this movement is as much as the selection point stays in view, but is displayed at the bottom (last line) of the viewable area of the memo.Normally no movement should occur, as in Delphi.