ListBox using RemoveItem

G

Guest

I’m having trouble using the RemoveItem on my ListBox, does anyone know a
better way?
I’m using a ListBox to display the results of a loan program. This sets up
the header
lstResult.ColumCount = 4
lstResult.ColumnHeads = True
lstResult.ColumnWidths = “.5in;1in;1in;1inâ€
lstResult.AddItem “Mo;Interest;Principal;Balanceâ€

This Adds Items to the ListBox and it work fine

FOR X=1 to Y
lstResult.AddItem (MonthNumber & “;†& MonthlyInterest & “;†& PrincipalPaid
& “;†& RemainigBalance)
NEXT

Now I need to clear the ListBox to run the program again
So using ListIndex and RemoveItem I try to clear the ListBox but
All combination that I have tried so far leaves the last row in the header
row.
Is their some way of deleting all the Items?
 
D

Douglas J. Steele

I believe the number of rows in Listboxes starts at 0, not 1.

However, if you're trying to remove all rows, it's simpler strictly to reset
the control's RowSource to a zero-length string:

lstResult.RowSource = ""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top