Einzelnen Beitrag anzeigen

Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#2

Re: Variable global in einer Pas Datei

  Alt 27. Jul 2007, 01:16
Hi trolojik2,
at first: Welcome to the Delphi-PRAXiS

I think, the ListBox isn't a good component to keep about 1000 items. Maybe you should take a look to Mike Lischke's VirtualStringTree.

I think you have a button to delele the news? So you should keep the delete pos into a variable and scroll to it, after you deleted the old news, just like that:

Delphi-Quellcode:
procedure TForm1.DeleteNews(Sender: TObject);
var
  I: Integer;
begin
  I := ListBox1.ItemIndex; // The "old newspos"
  ListBox1.Delete(I);
  ListBox1.ItemIndex := I;
end;
Regards,

Manuel
  Mit Zitat antworten Zitat