Quantcast
Channel: Set ListView scroll position
Viewing all articles
Browse latest Browse all 11

Set ListView scroll position

$
0
0

Hi,

I'm using a ListView in Details view and set Scrollable true. Frequently I update the ListView (clear all Items and add new Items). But this causes the scrollbars to set the scroll position to 0. Is it possible to save the scroll position before updating the View and set the position after updating?

 

With Win32Api “int horzScroll = GetScrollPos(lvAnalysis.Handle, SBS_HORZ);” I can get the current position, but when I use “SetScrollPos(lvAnalysis.Handle, SBS_HORZ, horzScroll, true);” only the scrollbar had a new position and the ListView itself doesn’t scroll. Also “SendMessage(lvAnalysis.Handle, WM_HSCROLL, (UIntPtr)(horzScroll<<16 | SB_THUMBPOSITION), IntPtr.Zero);” doesn’t work. Only with SB_PAGERIGHT or SB_LINERIGHT the ListView scrolls.

 

Does anybody know how to set the scroll position of a ListView?

 

Thanks

 


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>