Results 1 to 6 of 6

Thread: listview equivalent of List1.ListIndex

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Question listview equivalent of List1.ListIndex

    hello, I have a listview1 control and I would like to write the items currently displayed into an array. I also need to detect when the content visible (ex. via scroll click) changes. Please help. Thanks in advance.
    212 will lead you to the truth

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: listview equivalent of List1.ListIndex

    As far as the scroll.. you will have to hook the scrollbar with API's

    but the items

    VB Code:
    1. For x = 0 to ListView1.Listitems.Count
    2.     Debug.print Listview1.Listitems(x).Text
    3. Next
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: listview equivalent of List1.ListIndex

    Quote Originally Posted by Static
    VB Code:
    1. For x = 0 to ListView1.Listitems.Count
    2.     Debug.print Listview1.Listitems(x).Text
    3. Next
    This would return the text in column 1. Is that all you are concerned with, or are you asking about the entire listview row?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Re: listview equivalent of List1.ListIndex

    First off thanks to all of you guys for the help. Yes I do need to access all three columns of the listview. As far as the API call for the scroll. Does anyone have any simple sample code for this?
    212 will lead you to the truth

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking Re: listview equivalent of List1.ListIndex

    I got the column deal working.

    Listview1.ListItems.Item(i).Subitems(1).text

    Now if I can get anyone to post sample code on how to detect the listview1 scroll. Any ideas?
    212 will lead you to the truth

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: listview equivalent of List1.ListIndex

    I've never done it, but you should be able to subclass and detect the WM_SCROLL message (I think that's the right one).


    Has someone helped you? Then you can Rate their helpful post.

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