Listview remove fails 
Author Message
 Listview remove fails

Hi:
I am using VB6.  In code to remove a listview item, I remove by

listview.ListItems.Remove StringKey

Where StringKey is a valid key for a listitem in the listitems collection.
No error is raised, but the item is not removed.  It is driving me even more
crazy.  Does anyone have any idea as to why the item is not being removed.
I have tried called listview.refresh etc.  Doesn't help.

TIA,
Bill



Sun, 15 Jun 2003 23:07:25 GMT  
 Listview remove fails
Must delete index before listItem can be removed from listItems collection

This should do it
  ListView.ListItems.Remove ListView.SelectedItem.Index

Joe

Quote:

> Hi:
> I am using VB6.  In code to remove a listview item, I remove by

> listview.ListItems.Remove StringKey

> Where StringKey is a valid key for a listitem in the listitems collection.
> No error is raised, but the item is not removed.  It is driving me even more
> crazy.  Does anyone have any idea as to why the item is not being removed.
> I have tried called listview.refresh etc.  Doesn't help.

> TIA,
> Bill



Mon, 16 Jun 2003 09:22:39 GMT  
 Listview remove fails
Joe;
Deleting by either index or key will usually work.  Doesn't matter which one
you choose.  But I resort the listview on dates and numbers using API and
callbacks.  That scrambles the listitems collection and thus neither the
index or the key will work.  The only solution I have found is to
temporarily resort the listview with the stock text sorting and then delete
by key...

Cheers,
Bill


Quote:
> Must delete index before listItem can be removed from listItems collection

> This should do it
>   ListView.ListItems.Remove ListView.SelectedItem.Index

> Joe


> > Hi:
> > I am using VB6.  In code to remove a listview item, I remove by

> > listview.ListItems.Remove StringKey

> > Where StringKey is a valid key for a listitem in the listitems
collection.
> > No error is raised, but the item is not removed.  It is driving me even
more
> > crazy.  Does anyone have any idea as to why the item is not being
removed.
> > I have tried called listview.refresh etc.  Doesn't help.

> > TIA,
> > Bill



Fri, 20 Jun 2003 04:57:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Trim Function Fails in VBA Word 2002 to Remove Spaces

2. ListView Control - Removing selected items from the list

3. Removing an item from a listview

4. Removing duplicates from a ListView

5. Removing an item from a ListView

6. ListView remove

7. help adding and removing items from a listview

8. Remove multi-selected lines from listview

9. Q: How to get rid of ListView flicker when adding/removing items

10. remove multi-selected lines from listview box

11. Remove Listview entries, How?

12. SHFileOp and removing corresponding items from ListView

 

 
Powered by phpBB® Forum Software