How do you use MFC CScrollbar controls?(你如何使用 MFC CScrollbar 控件?)
问题描述
我已将水平 CScrollBar 控件拖放到对话框中.你到底是怎么用它的??
I have dropped a horizontal CScrollBar control onto a dialog box. How on earth do you use it??
我尝试将手柄向右移动,但它直接跳回左侧.所以我想我可能需要设置范围.我调用了 SetScrollRange(0, 100),它仍然做同样的事情.我在谷歌上找不到任何有帮助的例子——所有滚动条引用似乎都是指使用视图类等,但这不是我想做的.
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)?
推荐答案
想知道的,需要自己处理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.
这篇关于你如何使用 MFC CScrollbar 控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:你如何使用 MFC CScrollbar 控件?


基础教程推荐
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 使用从字符串中提取的参数调用函数 2022-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01