views:

343

answers:

1

I have a Panel on a TabPage on a TabControl that is on a form.

I have a Mouse Event function "control_MouseWheel".

If I bind that function to the MouseWheel event of just the panel, nothing happens when I scroll the mousewheel.

If I bind that function to the MouseWheel event of both the panel and the TabPage or all three of the Panel, the TabPage and the TabControl, nothing happens.

If I then bind that function to the MouseWheel event of the form, the mouse event handler fires, but only on the form. I can see this via the use of ConsoleWriteline().

How do I get it to fire for the underlying panel that I actually want to use the mouse wheel event?

Am I missing a property setting for the stack of child controls?

+1  A: 

The MouseWheel event is sent to the control that has focus.

Since panels cannot have focus, they will never get MouseWheel events.

SLaks