获取ListView滚动条事件
public delegate void ListViewScroll(object sender, bool vscroll);public event ListViewScroll OnScroll;
protected override void WndProc(ref Message m)//捕获滚动条
{
int WM_VSCROLL = 0x0115;
int WM_HSCROLL = 0x0114;
if (m.Msg == WM_VSCROLL )
{
ListViewColumn宽度.rar
(45.98 KB)
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);
}
我运行了,但是不能获取。。。