如何使用MFC CScrollbar控件? [英] How do you use MFC CScrollbar controls?
问题描述
我将水平CScrollBar控件放到了对话框上.您到底如何使用它?
I have dropped a horizontal CScrollBar control onto a dialog box. How on earth do you use it??
我尝试将手柄向右移动,然后直接跳回左侧.所以我认为可能需要设置范围.我调用了SetScrollRange(0,100),它仍然做同样的事情.我在Google上找不到任何有帮助的示例-所有滚动条引用似乎都是使用视图类等引用的,但这不是我想要的.
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控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!