Weird

  • Thread starter Thread starter cql90
  • Start date Start date
C

cql90

Hi All Pro,

I try to delete item from the listbox control, but I am always got this
error message after the item was removed from the list:

" There is no row at position 0 "

Here is how I do it:

listbox1.Items.RemoveAt( listbox1.SelectedIndex );

listbox1.ClearSelected();



Any help is greatly appreciated. Thanks you all in advance...



Kate
 
If the ListBox is empty, there is no row at position 0. There is no row
period.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
 
Make sure and check the count before you try to delete any rows.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
 

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

Back
Top