1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
var
igPos : TPointF;
bstop : boolean ;
..
procedure TForm1.Button2Click(Sender: TObject);
begin
ListBox1.ViewportPosition := igPos ;
end;
procedure TForm1.ListBox1ViewportPositionChange(Sender: TObject;
const OldViewportPosition, NewViewportPosition: TPointF; const ContentSizeChanged: Boolean);
var
begin
if NewViewportPosition.Y > OldViewportPosition.Y + (round(ListBox1.ItemHeight) * 4) then
begin
if bstop then
begin
igPos .y := OldViewportPosition.Y + (round(ListBox1.ItemHeight) * 4);
bstop := False;
end;
end;
end; |
Partager