Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to support XP.SetScrollInfo can't do well in XP.
how can i set the scrollbar positon in CListCtrl.
i try to use
int		nHscroll = ctrl.GetScrollPos(SB_HORZ) ;
		CSize	size ; = nHscroll ;

but In fact next time, i get the positon, it is wrong.
also i want the content move with the scrollbar.
i try the function SetScrollPos.the content is not move with the scrollbar.

anyone help
Updated 12-Jun-12 3:51am

Not exactly sure what you are trying to do, but "MaintainScrollPositionOnPostBack=Tue" inside your page directive tags will position the scrollbar to where it was prior to a postback.
Share this answer
Sandeep Mewara 12-Jun-12 11:29am    
He is talking of C++ and not ASP.NET
Richard C Bishop 12-Jun-12 11:33am    
Oh man, guess I should pay a bit closer attention to the keywords.

My apologies.
Sandeep Mewara 12-Jun-12 12:56pm    
No issues.
To make scrolling work you must override scroll messages.

What is the problem with SetScrollInfo in XP?

There is an article with a helper class to handle scrolling in MFC:

Add Scrolling to a CWnd or CDialog using a C++ Helper Class[^]

It is for CWnd but it can be adapted to CListCtrl I think.
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