Connecting Tech Pros Worldwide Help | Site Map

Help repositioning listview item

  #1  
Old September 23rd, 2008, 04:35 PM
Daniel Lohmann
Guest
 
Posts: n/a
Using VB6



I would like to reposition a selected item in listview (report mode) to the
top of the view. For a listbox, I was able to do the following:

'Move the selected URL to the top of the list box

If lstURLs.ListItems.Count - lstURLs.ListIndex >= 54 Then

lstURLs.TopIndex = lstURLs.ListIndex

End If

Where 54 is the number of rows displayed in the listbox. TopIndex can both
get and set the top item.



Is there a way of doing the same in a listview? I can get the top item with
GetFirstVisible.Index but the best I've been able to do is ensure visibility
with ListItems(selected).EnsureVisible. However, this does not reposition
the selected row to the top. Basically looking for a "SetFirstVisible.Index"

Thanks


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving listview items Nick answers 6 November 21st, 2005 12:19 PM