如何使列表视图滚动事件 [英] how to make scroll event for listview

查看:100
本文介绍了如何使列表视图滚动事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为列表视图中的srcol事件
我发现一些作品,但使用scrol酒吧scrol时只触发事件,它不响应鼠标滚轮或箭头,

I want to make an event for the srcol in listview i have found something that works but it only fires the event when scrol using the scrol bar, it does not respond to scroll by mouse wheel or arrows,

 private const int WM_HSCROLL = 0x114;
    private const int WM_VSCROLL = 0x115;


    public event EventHandler Scroll;

    protected void OnScroll()
    {

        if (this.Scroll != null)
            this.Scroll(this, EventArgs.Empty);

    }

    protected override void WndProc(ref System.Windows.Forms.Message m)
    {
        base.WndProc(ref m);
        if (m.Msg == WM_HSCROLL || m.Msg == WM_VSCROLL )
            this.OnScroll();
    }

还有什么常数我要开枪鼠标滚轮和键盘上/下键事件?
感谢帮助

What else constants i need to fire the event on mouse wheel and keyboard up/down button? thanks for helping

推荐答案

鼠标滚轮 m.Msg 值应为:

private const int WM_MOUSEWHEEL = 0x020A;

这篇关于如何使列表视图滚动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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