home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,683 of 10,840   
   Daniel Lohmann to All   
   Help repositioning listview item   
   23 Sep 08 11:28:32   
   
   From: daniel@losoft.de   
      
   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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca