获取ListView垂直滚动条上一页/下一页事件

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace scrollBarStudy
{
    
public partial class PageView : ListView
    {
        
public event EventHandler ShowMessage;

        
public PageView()
        {
            InitializeComponent();
        }
        
protected override void WndProc(ref Message m)
        {
            
int WM_VSCROLL = 0x115;
            
int WM_HSCROLL = 0x114;


            
if (m.Msg == WM_VSCROLL)
            {
                
switch ((uint)m.WParam)
                {
                    
// Page up
                    case 0:
                        MessageBox.Show(
"up!");
                        
base.WndProc(ref m);
                        
break;
                    
case 1:
                        MessageBox.Show(
"Down!");
                        
base.WndProc(ref m);
                        
break;
                    
default:
                        
base.WndProc(ref m);
                        
break;
                }
            }


            
base.WndProc(ref m); 

        }
       
    }
}
posted @ 2008-08-15 17:19  公元前  阅读(768)  评论(0编辑  收藏  举报