如何使用MFC CScrollbar控件?

发布于 2024-10-06 01:32:19 字数 219 浏览 9 评论 0原文

我已将水平 CScrollBar 控件放到对话框中。你到底怎么用它?

我尝试将手柄移至右侧,但它直接跳回左侧。所以我想我可能需要设置范围。我调用了 SetScrollRange( 0, 100 ),它仍然做同样的事情。我在 Google 上找不到任何有帮助的示例 - 所有滚动条引用似乎都指使用视图类等,但这不是我想要做的。

我想做的就是移动手柄并收到一些描述的通知消息,我该怎么做(请问)?

I have dropped a horizontal CScrollBar control onto a dialog box. How on earth do you use it??

I tried moving the grip to the right and it jumped straight back to the left.. so I figured I may need to set the range. I called SetScrollRange( 0, 100 ) and it still does the same thing. I can't find any examples on Google that help - all scrollbar references seem to refer to using the view class etc etc but thats not what I want to do.

All I want to do is move the grip and get a notification message back of some description, how do I do that (please)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

壹場煙雨 2024-10-13 01:32:19

对于任何想知道的人,您需要自己处理 WM_HSCROLL/WM_VSCROLL 消息..并在收到 SB_THUMBPOSITION 消息时自己调用 SetScrollPos() 。

For anybody that wants to know, you need to handle the WM_HSCROLL/WM_VSCROLL messages yourself.. and call SetScrollPos() yourself when receiving the SB_THUMBPOSITION messages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文