G
Glenn Nilsson
Hi,
I've subclassed a Panel and trying to catch the MouseWheel event, non
successful I tried to override OnMouseWheel, but none of the above will
trigger the event.
The code is this:
namespace Wailqill.Windows.Forms
{
public class FlowPanel : System.Windows.Forms.Panel
{
public FlowPanel()
{
this.MouseWheel += new MouseEventHandler(FlowPanel_MouseWheel);
}
protected override void OnMouseWheel(MouseEventArgs e)
{
MessageBox.Show("ugh1!");
base.OnMouseWheel(e);
}
private void FlowPanel_MouseWheel(object sender, MouseEventArgs e)
{
MessageBox.Show("ugh2!");
}
}
}
None of the messageboxes will show. After this I tried the code directly
on an inherited form, and that works just great.
What have I missed?
/Glenn
I've subclassed a Panel and trying to catch the MouseWheel event, non
successful I tried to override OnMouseWheel, but none of the above will
trigger the event.
The code is this:
namespace Wailqill.Windows.Forms
{
public class FlowPanel : System.Windows.Forms.Panel
{
public FlowPanel()
{
this.MouseWheel += new MouseEventHandler(FlowPanel_MouseWheel);
}
protected override void OnMouseWheel(MouseEventArgs e)
{
MessageBox.Show("ugh1!");
base.OnMouseWheel(e);
}
private void FlowPanel_MouseWheel(object sender, MouseEventArgs e)
{
MessageBox.Show("ugh2!");
}
}
}
None of the messageboxes will show. After this I tried the code directly
on an inherited form, and that works just great.
What have I missed?
/Glenn