Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've searched everywhere Google points me to and I'm still having trouble.
I can send a message to a textbox to scroll its contents after moving the scrollbar with setScrollPos.
This is done with PostMessage and posting the WM_VSCROLL message (which is an int of 277).

My problem is that this does not work for a listview. Suggestions were to use LVM_SCROLL.
I've searched for how to implement this message or just the constant int to pass, but had no luck.

Any help would be appreciated!
Posted
Updated 25-Jan-11 2:02am
v2

XtErMiNaToR102 wrote:
I've searched for how to implement the message or just the constant int to pass, but no luck


You may also use the ListView_Scroll macro[^]. It looks straightforward and well documented.
:)
 
Share this answer
 
Comments
XtErMiNaToR102 25-Jan-11 8:20am    
Forgive my stupid question, but how exactly do I implement it? I'm fairly new to C# and do not yet know all the tricks. Thanks in advance!
CPallini 25-Jan-11 8:30am    
So the C# tag wasn't a mistake. Why aren't you using Windows Forms? Anyway I suppose you cannot use the macro from C#, you've to use SendMessage instead.
XtErMiNaToR102 25-Jan-11 8:58am    
I am using winForms and PostMessage API call, but the LVM_SCROLL message doesn't work. The listView receives the message but ignores it.
Solved it.

I had to use SendMessage API with LVM_SCROLL. It scrolls the ListView by the amount of pixels specified.

Thanks!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900