如何在多行编辑框中收到滚动条滑块拖动的通知? [英] How do I get notification of a scrollbar thumb drag in a multiline edit box?

查看:123
本文介绍了如何在多行编辑框中收到滚动条滑块拖动的通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户点击多行编辑框中的垂直滚动条时,会发送EN_VSCROLL通知。如何在拖动滚动条滑块时收到通知?

When a user clicks on the vertical scrollbar in a multiline edit box, the EN_VSCROLL notification is sent. How can I get notification when the scrollbar thumb is dragged?

推荐答案

不幸的是,似乎 - 这是你不能拥有的。



查看 EN_VSCROLL 的文档: MSDN> EN_VSCROLL通知代码我们找到以下gem:





备注

消息发送以显示垂直滚动条上的以下鼠标事件:单击箭头按钮或在箭头按钮和拇指之间单击。但是,单击滚动条鼠标本身时不会发送消息。(原文如此 - 我认为鼠标应该是拇指)当键盘事件导致编辑控件的视图区域发生更改时,也会发送消息,例如,按HOME,END,PAGE UP,PAGE DOWN,UP ARROW或DOWN ARROW。




所以,因为你必须点击拇指以便拖动它并且因为当单击滚动条鼠标本身时通知不会被触发,所以你没有得到任何。您可以捕获阵容/页面向上和向下/向下翻页事件,但即使这样,您也不会被告知它是哪种类型的事件 - 仅仅是滚动事件发生了。 :(
Unfortunately, so it seems - this is something you can't have.

Reviewing the docs for EN_VSCROLL here: MSDN>EN_VSCROLL notification code we find the following gem:


Remarks
This message is sent for the following mouse events on the vertical scroll bar: clicking either arrow button or clicking between the arrow button and the thumb. However, the message is not sent when clicking the scroll bar mouse itself.(sic - I think mouse should be thumb) The message is also sent when a keyboard event causes a change in the view area of the edit control, for example, pressing HOME, END, PAGE UP, PAGE DOWN, UP ARROW, or DOWN ARROW.


So, since you have to click on the thumb in order to drag it AND since notifications don't get fired when "clicking the scroll bar mouse itself", you don't get any. You can catch line-up/page-up and line-down/page-down events, but even then, you don't get told which type of event it was - merely that a scroll event happened. :(


你可以捕获要解决的WM_VSCROLL消息。
you can capture WM_VSCROLL message to solve.


这篇关于如何在多行编辑框中收到滚动条滑块拖动的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆