ListView joins Scroll events

xiaoxiao2021-03-06  45

Example code:

Class MyListView: ListView

{

Public Event athandler HScroll;

Public Event athandler vscroll;

MyListView () {this.hscroll = New EventHandler (onHScroll); this.vscroll = new eventhandler (onvscroll);}

const int WM_HSCROLL = 0x0114; const int WM_VSCROLL = 0x0115; protected override void WndProc (ref Message m) {if (m.Msg == WM_HSCROLL) {OnHScroll (this, new EventArgs ());} else if (m.Msg = = Wm_vscroll) {ONVSCROLL (this, new eventargs ());

Base.WndProc (Ref M);

Virtual protected void onhscroll (Object sender, Eventargs e) {}

Virtual protected void onvscroll (Object sender, eventargs e) {}}

转载请注明原文地址:https://www.9cbs.com/read-71577.html

New Post(0)