ListBox question

  • Thread starter Thread starter Ilya Dyoshin
  • Start date Start date
I

Ilya Dyoshin

Hi all!

In my form I use ListBox to put some technical data - log of my program.
And it groes up to very huge massive in memory. But exactly I need only
100-150 last records.

I use logListBox->Items->Add(System::String("log records"); for adding
information. So I've been thinking about to do some
logListBox->Items->RemoveAt(i); in the event OnItemAdd, but there is no
such event!

Any suggestions?
 
Hi all!

In my form I use ListBox to put some technical data - log of my program.
And it groes up to very huge massive in memory. But exactly I need only
100-150 last records.

I use logListBox->Items->Add(System::String("log records"); for adding
information. So I've been thinking about to do some
logListBox->Items->RemoveAt(i); in the event OnItemAdd, but there is no
such event!

Any suggestions?

In the code that adds the item, check the count property of the items.
If it is > 150 then remove item 0 from the list. this will keep the
list at 150 items.


Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
Back
Top