Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listview control - removing rows 1

Status
Not open for further replies.

peekay

Programmer
Oct 11, 1999
324
ZA
I have listed this question previously but did not get a reply. Can somebody please help.<br>
If I have a listview control with a number of items listed in it how do i remove only one item from it.<br>
The nearest solution i tried was<br>
lvItems.Listitems(i).remove<br>
but it did not work.<br>
I do not wish to clear the listview and write all the items except the one i wish to remove from it<br>
PK<br>

 
if you have a command button to remove an item and the item is selected, this should work:<br>
i = lstBox.ListIndex<br>
lstBox.RemoveItem(i)<br>
<br>
I used this in an application I wrote and it worked fine.<br>

 
if you have a command button to remove an item and the item is selected, this should work:<br>
i = lstBox.ListIndex<br>
lstBox.RemoveItem(i)<br>
<br>
I used this in an application I wrote and it worked fine.<br>

 
Hi WallyW<br>
Thanks for the tip<br>
I however think you are referring to a listbox control and not a listview control - can you please check<br>
Regards,<br>
PK
 
PK<br>
<br>
This works ok.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;ListView1.ListItems.Add 1, &quot;hello&quot;, &quot;hello&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;ListView1.ListItems.Remove 1<br>
<br>
Regards<br>
<br>
Mike<br>
<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Hi Mike <br>
Thanks for the tip which solved my problem.<br>
Can you also please look under another posting of mine find-a-file which I am sure you can also solve easily. It involves calling the API.<br>
Thanks<br>
PK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top