ListView sorting with vertical scrollbar. 
Author Message
 ListView sorting with vertical scrollbar.

I'm using a listview in report mode which is being sorted ascendingly on
SortKey 1 and my problem is this. When the listview is populated it has so
many entries in it that the user must use the vertical scrollbar to scroll
to the bottom of the list. Which is fine, but when the form initially loads
it automatically scrolls itself 3/4 the of the way down the list. How do I
prevent this from happening. It doesn't automatically scroll down when it's
not sorted, only when it's sorted. Why? Does anyone have a work around?

regards,

Cameron Stevens

Note: if replying by e-mail remove the letters "NOSPAM" from my address.



Sat, 24 Feb 2001 03:00:00 GMT  
 ListView sorting with vertical scrollbar.
On Tue, 8 Sep 1998 19:06:34 +1000, "Cameron Stevens"

Quote:

>I'm using a listview in report mode which is being sorted ascendingly on
>SortKey 1 and my problem is this. When the listview is populated it has so
>many entries in it that the user must use the vertical scrollbar to scroll
>to the bottom of the list. Which is fine, but when the form initially loads
>it automatically scrolls itself 3/4 the of the way down the list. How do I
>prevent this from happening. It doesn't automatically scroll down when it's
>not sorted, only when it's sorted. Why? Does anyone have a work around?

You can force the listview to scroll to any point by setting the
selected item:

Set fForm.lvListView.SelectedItem = fForm.lvListView.ListItems(iIndex)

where iIndex is
        1 for the first item in the list
        fForm.lvListView.ListItems.Count for the last item
or anything in between.

Include a 'Set' call in your form load and/or ListView population
code.

JB.



Sun, 25 Feb 2001 03:00:00 GMT  
 ListView sorting with vertical scrollbar.

Quote:
>You can force the listview to scroll to any point by setting the
>selected item:

>Set fForm.lvListView.SelectedItem = fForm.lvListView.ListItems(iIndex)

Hooray!!!

Worked like a charm.

Thanks John.



Mon, 26 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Listview and the Vertical scrollbar

2. ListView control - Vertical scrollbar

3. Position listview vertical scrollbar where I want it in VB6

4. disabling vertical scrollbar in vb6 listview

5. Datagrid Vertical Scrollbar

6. DataGrid Vertical ScrollBar Always On?

7. Using several listboxes with 1 vertical scrollbar (result of query)

8. help...with listbox's vertical scrollbar..

9. vertical scrollbar

10. Controling Vertical Scrollbar

11. PictureBox and Vertical, Horizontal ScrollBar

12. Question: Optional vertical scrollbar and textbox?

 

 
Powered by phpBB® Forum Software