????
对不起,我不知道为何要这么做
==================================================
我有个很笨的方法:
for i := 0 to 48 do
begin
SendMessage(Memo1.handle,WM_VSCROLL,SB_LINEDOWN,10);
end;
==================================================
估计要用 WM_VSCROLL 的 SB_THUMBPOSITION,正在研究中
procedure TForm1.SetMemoLine(LineNum: Integer);
var
ScrollLn, SelEnd: Integer;
begin
with memo1 do begin
ScrollLn := LineNum - 1 - Perform(EM_GETFIRSTVISIBLELINE, 0, 0);
Perform(EM_LINESCROLL, 0, ScrollLn);
SetFocus;
end;
end