Results 1 to 5 of 5

Thread: ListView problem, how to know which data is selected

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2001
    Location
    Germany, BW
    Posts
    157

    ListView problem, how to know which data is selected

    hi, i have tested the listview the first time.
    and i wonder how i can get the index of the selected item.

    the listview has 2 columns, and some entrys as rows
    how can i get the index number of the selected row
    (multiselect is false)

    these don't work:

    Code:
    ListView1.ListItems.Item.Index
    ListView1.Index
    #

    thx for your time
    pa
    Old enough to know better,
    but young enough to don't give a ****!

  2. #2
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    VB Code:
    1. Option Explicit
    2.  
    3. Dim CurrentItem As ListItem
    4.  
    5. Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    6.     Set CurrentItem = Item
    7. End Sub
    McGenius

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    The ListView has a SelectedItem property.

  4. #4
    Addicted Member aldinator's Avatar
    Join Date
    May 2002
    Location
    Canada - better than all the rest!
    Posts
    216
    VB Code:
    1. ListView1.SelectedItem.Index

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2001
    Location
    Germany, BW
    Posts
    157
    thanks, now it is working fine

    greez pa
    Old enough to know better,
    but young enough to don't give a ****!

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