我如何在没有SetScrollInfo的情况下设置滚动条位置

编程入门 行业动态 更新时间:2024-10-25 02:18:59
本文介绍了我如何在没有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添加滚动助手类 [ ^ ] 它适用于CWnd,但我认为它可以适应CListCtrl. 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.

更多推荐

我如何在没有SetScrollInfo的情况下设置滚动条位置

本文发布于:2023-11-11 06:53:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577687.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:滚动条   情况下   位置   如何在   SetScrollInfo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!