Results 1 to 5 of 5

Thread: Get Index of Selecteditem in ListView??[Resolved]

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Get Index of Selecteditem in ListView??[Resolved]

    How ?
    Last edited by Pirate; Apr 4th, 2003 at 06:57 AM.

  2. #2
    Member
    Join Date
    Sep 2002
    Posts
    53
    Does this little example help.

    Code:
    For i = 0 To ListView1.Items.Count - 1
    If ListView1.Items(i).Selected = True Then
    Console.WriteLine(ListView1.Items(i).Index & " " & ListView1.Items(i).Text)
    End If
    Next

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    http://www.vb-tech.com/skills/contro...om_columns.htm

    - ignore that...it only gives the selected item not it's index.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by JustAProg
    Does this little example help.

    Code:
    For i = 0 To ListView1.Items.Count - 1
    If ListView1.Items(i).Selected = True Then
    Console.WriteLine(ListView1.Items(i).Index & " " & ListView1.Items(i).Text)
    End If
    Next
    Thanx , that worked out .

  5. #5

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Good link nswan as I'll need it so soon .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width