Help repositioning listview item

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Lohmann

    #1

    Help repositioning listview item

    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.ListIte ms.Count - lstURLs.ListInd ex >= 54 Then

    lstURLs.TopInde x = lstURLs.ListInd ex

    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(selec ted).EnsureVisi ble. However, this does not reposition
    the selected row to the top. Basically looking for a "SetFirstVisibl e.Index"

    Thanks


Working...