Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Listview question

Posted on 2006-06-29
4
Medium Priority
?
215 Views
Last Modified: 2010-04-23
I am having problems with what I think should be a simple thing to figure out..  Anyway I would like to view the record below a selected list view item for comparison.
I know for the selected item it is:

ListView1.SelectedItems.Item(0).ToString()

but how could you read the item(s) on the line below as well?

Thanks in advance!
-D-
0
Comment
Question by:John Gates, CISSP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 500 total points
ID: 17009996
To get the next item in the list, you can do (taking into consideration that you should check that you're not currently on the last item!):

        ListView1.Items(ListView1.SelectedItems.Item(0).Index + 1)
0
 
LVL 18

Author Comment

by:John Gates, CISSP
ID: 17010083
How would you check if you were at the last item>?
0
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17010318
To check that, you need to check the index of the current item against the total number of items in the list:

       Dim objItem As Object

        If ListView1.SelectedItems.Item(0).Index <> ListView1.Items.Count - 1 Then
            objItem = ListView1.Items(ListView1.SelectedItems.Item(0).Index + 1)
        Else
            MsgBox("You are at the last item")
        End If
0
 
LVL 18

Author Comment

by:John Gates, CISSP
ID: 17010948
Thank you for your help 8)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question