How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView?
How does one loop through the items in a ListView? How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
Go Back  Xtreme Visual Basic Talk > > > How does one loop through the items in a ListView?


Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2004, 10:27 AM
TANKERx TANKERx is offline
Newcomer
 
Join Date: Jan 2004
Location: Cwmtwrch, South Wales
Posts: 9
Default How does one loop through the items in a ListView?


Hi people,

Sorry if this has already been asked (I have searched but not found an answer).

I have a ListView and want to loop through it, checking the text property of each item. I'm guessing that I need to use a ListViewItemCollection, but I don't know how to initialise it (I had no trouble doing this in VB6).

I would be well grateful if someone just could give me a brief example of how to loop through a ListView like this (even if its just the first few lines of a Sub so I know where and what to initialise).

Thanks in advance for your time

TANKERx (New to VB.Net)
Reply With Quote
  #2  
Old 01-26-2004, 10:42 AM
Csharp's Avatar
CsharpHow does one loop through the items in a ListView? Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

like this ...
Code:
Dim lvi As ListViewItem For Each lvi In ListView1.Items MessageBox.Show(lvi.Text) Next
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Standards and Practices loquin Tutors' Corner 10 07-28-2006 01:16 PM
Edit items in listview Bart1123 General 7 01-07-2004 02:38 PM
vc++6: any1 know how to use threads eg _beginthread(), _endthread() funcs clockworkorange Miscellaneous Languages 2 06-09-2003 10:20 PM
Removing Items from another ListView dazza33 General 2 02-16-2003 01:53 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView? How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView? How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
 
How does one loop through the items in a ListView?
How does one loop through the items in a ListView?
 
-->