Fire panel scroll bar event

  • Thread starter Thread starter Benny
  • Start date Start date
B

Benny

Hello experts,

Currently i am working on a windows form application using vs.net 2002
with C#.

I have a panel in the form that it's AutoScroll property is set to true.
The question is how can i fire an event when the user click/scroll on
the scroll bar?


Thanks,

Benny

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Hi,
You may use WndProc to catch any messages, certainly including WM_HSCROLLl
or WM_VSCROLL
 
Like this:

protected override void WndProc(ref System.Windows.Forms.Message msg)
{
switch(msg.Msg)
{
case (int)Win32.Msgs.WM_VSCROLL:
case (int)Win32.Msgs.WM_HSCROLL:
{
//to do...
break;
}
}
base.WndProc(ref msg);
}

Here, Win32.Msgs is an enum type which includes most of Win32 Messages in
winapi.h
 
Back
Top