Connecting Tech Pros Worldwide Forums | Help | Site Map

Help repositioning listview item

Daniel Lohmann
Guest
 
Posts: n/a
#1: Sep 23 '08
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 Visual Basic 4 / 5 / 6 bytes