troubleshooting Question

Scrolling a listview programmatically

Avatar of rdorow
rdorow asked on
Visual Basic Classic
9 Comments1 Solution525 ViewsLast Modified:
I am trying to scroll a listview control programmatically to make a particular list item the first in the list.
Currently I have the following:

For i = 1 To 3
    SendMessage listview.hwnd, WM_VSCROLL, 1, 1

When I run this, nothing happens, but when I step through the code in the VB IDE, the listview scrolls correctly. Do I need to repaint the control at the end or something? I have tried:

SendMessage listview.hwnd, WM_PAINT, 1, 0

but that makes no difference.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros