Leider nicht.
Delphi-Quellcode:
procedure TfrmMain.lbListScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
var Rect : TRect;
WinInfo : TWindowInfo;
iHeight : integer;
begin
if ScrollCode = scLineDown then
begin
Rect := lbList.ItemRect(0);
xiScrollV.Position := (Rect.Top div lbList.ItemHeight * -1);
end else
if ScrollCode = scLineUp then
begin
ZeroMemory(@WinInfo, sizeOf(WinInfo));
WinInfo.cbSize:= SizeOf(WinInfo);
GetWindowInfo(lbList.Handle, WinInfo);
//iHeight= sichtbare Bereich in der Listbox
iHeight:= WinInfo.rcClient.Bottom- WinInfo.rcClient.Top;
Rect := lbList.ItemRect(lbList.Count);
if Rect.Bottom > iHeight then
xiScrollV.Position := ((Rect.Bottom- iHeight) div lbList.ItemHeight);
end;
end;
Er scrollt hoch und danach wieder runter.