473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Remove ALL items from ListView?

rdi
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)
Nov 20 '05 #1
4 4731
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #2
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #3
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #4
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rdi | last post by:
Why does the following NOT remove the items from the ListView? I need to remove all the items and re-build the LV based on new information. Thanks. -- RDI (remove the exclamation from...
2
by: Mamatha | last post by:
Hi I have an application with listview.When i click on one button the data will be displayed like this in the listview: colA colB colC ----- ----- ------...
7
by: Progalex | last post by:
Hi everybody! I have a listview and a treeview in a form . With an OpenDialog I let the user select multiple files and then these files are added to the listview with the complete pathname,...
6
by: Nick | last post by:
Hi there, I'm trying to implement drag-drop for my listview control in large icon view mode. Unfortunately the order of the items gets completely messed up upon inserting the item back into the...
7
by: Mike Johnson | last post by:
How do I remove a item that's been selected from a listview? I'm using Visual Basic 2005 express edition. Thanks
2
by: Kela | last post by:
An interesting problem: I have a ListView with LabelEdit set to TRUE. When I change the label, I want to make some decisions as to whether the ListViewItem (that's just been edited) should stay in...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.