Scrolling a listview control in .net
-
Hi All, I am using a .net listview control with the AutoScroll property set. I want to programatically scroll the listview control. I tried using P/Invoke messages. When I used the SetScrollPos message, the scroll bar moves but the content of the listview itself doesnt move. Anbody faced a similar problem before? Any clue how i can solve this??
-
Hi All, I am using a .net listview control with the AutoScroll property set. I want to programatically scroll the listview control. I tried using P/Invoke messages. When I used the SetScrollPos message, the scroll bar moves but the content of the listview itself doesnt move. Anbody faced a similar problem before? Any clue how i can solve this??
AutoScroll doesn't do what you apparently think it does. P/Invoking the Win32 API is also overkill. All you have to do is call the ListView's
.EnsureVisible(_index_)
method! Documentation[^] on ListView.EnsureVisible method Dave Kreskowiak Microsoft MVP - Visual Basic