Removing items in a listview 
Author Message
 Removing items in a listview

Hi!
I sure have some problems with figuring out how listview controls work.
I have a listview in which I have inserted a textvalue, 2 subitems and a
keyvalue.
Now I want to remove an item from the list. I know the key and the text
value.
I have tried the following:

Dim Itmx as listview

'Find the item I'm looking for
Set Itmx = frmPhonebook.lwPhonelist.FindItem(Trim(txtLocation), lvwText, ,
0)
'Set it the selected value -THIS DOES NOT WORK
Set frmPhonebook.listItems.selected= Itmx
'Remove the listitem from the list
lwPhonelist.ListItems.Remove lwPhonelist.SelectedItem.Index

Please help! How do I set the found item to be the selected one so I can
remove it???
Thanks

HiQ Data AB
Box 7421/Sveav?gen 17, 7tr
103 91 Stockholm - Sweden
Tele: +46 8 588 90 000
Fax:  +46 8 588 90 001
Mobil:+46 704 200 053



Mon, 03 Jul 2000 03:00:00 GMT  
 Removing items in a listview

Quote:
> Dim Itmx as listview

> 'Find the item I'm looking for
> Set Itmx = frmPhonebook.lwPhonelist.FindItem(Trim(txtLocation), lvwText,
,
> 0)
> 'Set it the selected value -THIS DOES NOT WORK
> Set frmPhonebook.listItems.selected= Itmx
> 'Remove the listitem from the list
> lwPhonelist.ListItems.Remove lwPhonelist.SelectedItem.Index

I have not understood role of the <listItems>,
but I guess the following could work

Set Itmx = frmPhonebook.lwPhonelist.FindItem(Trim(txtLocation), lvwText, ,
0)
if not is nothing then wPhonelist.ListItems.Remove Itmx.key

Ernest.



Mon, 03 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help adding and removing items from a listview

2. removing items from a listview

3. How to remove items in a listview?

4. How to remove items from the listview control ?

5. ListView Control - Removing selected items from the list

6. Removing an item from a listview

7. Removing an item from a ListView

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

9. SHFileOp and removing corresponding items from ListView

10. Remove Selected item in ListView Control

11. ListView items remain indented after removing icons

12. Remove selected items from a listview control in report format

 

 
Powered by phpBB® Forum Software