没有焦点C#的ListView鼠标滚轮滚动 [英] C# ListView mouse wheel scroll without focus

查看:510
本文介绍了没有焦点C#的ListView鼠标滚轮滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与一个ListView设置为详细WinForms应用程序,使多个列可以显示出来。

I'm making a WinForms app with a ListView set to detail so that several columns can be displayed.

我想这个列表滚动,当鼠标悬停在控制和用户使用鼠标滚轮。现在,只有滚动时发生在ListView具有焦点。

I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListView has focus.

我怎样才能使ListView的滚动,即使它不具有焦点?

How can I make the ListView scroll even when it doesn't have focus?

推荐答案

你通常只得到鼠标/键盘事件,以一个窗口或控制时,它具有焦点。如果你想看到他们没有焦点,然后你将有地方放一个低级别挂钩。

You'll normally only get mouse/keyboard events to a window or control when it has focus. If you want to see them without focus then you're going to have to put in place a lower-level hook.

下面是一个例子低水平鼠标钩子

这篇关于没有焦点C#的ListView鼠标滚轮滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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