Fire panel scroll bar event

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!
 
A

Alan

Hi,
You may use WndProc to catch any messages, certainly including WM_HSCROLLl
or WM_VSCROLL
 
A

Alan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top