// Eine Listbox
wird (vertikal)
von einer externen Scrollbar procedure MaxBestimmen(lb: TListbox; sb: TSCrollBar);
var
hlp: integer;
begin
hlp := lb.items.count -
lb.clientheight div (lb.itemrect(0).bottom - lb.itemrect(0).top);
if hlp < 0 then sb.max := 0 else
sb.max := hlp;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Scrollbar1.Kind := sbVertical;
MaxBestimmen(listbox1, scrollbar1);
scrollbar1.position := listbox1.topindex;
end;
procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
listbox1.topindex := scrollbar1.position;
end;
|
Zugriffe seit 6.9.2001 auf Delphi-Ecke





