我如何在没有SetScrollInfo的情况下设置滚动条位置
问题描述:
我想支持XP.SetScrollInfo在XP中表现不佳.
如何在CListCtrl中设置滚动条位置.
我尝试使用
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 ;
size.cx = nHscroll ;
ctrl.Scroll(size)
但实际上,下一次,我得到了正子,这是错误的.
我也想用滚动条移动内容.
我尝试使用功能SetScrollPos.内容不会随滚动条移动.
任何人都可以帮助
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
答
不确定自己要做什么,但是页面指令标记内的"MaintainScrollPositionOnPostBack = Tue"会将滚动条定位到之前的位置.一个回发.
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.
要使滚动工作,您必须覆盖滚动消息.
XP中的SetScrollInfo有什么问题?
有一篇带有帮助器类的文章来处理MFC中的滚动:
使用C ++向CWnd或CDialog添加滚动助手类 [
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.