End Google Ads 201810 - BS.net 01 --> Could someone help me here please? I have a control which I derived from another. For the purpose of this post, let's say I derived from a Panel to make my own custom Panel.

Now, I want to write my own MouseClick event for this control so here is what I have:

public class MyPanel : Panel
{
public MyPanel()
{
this.MouseClick += new MouseEventHandler(MyPanel_MouseClick);
}

private void MyPanel_MouseClick(object sender, MouseEventArgs e)
{
// My code here
}
}

This works and I can put the control on a form and subscribe to its MouseClick event. What then happens in run time when the control is clicked is that the event handler specified on the form is fired first and after that has finished the event handler in the control (the one in the block of code above) is fired.

My problem is that I wanted it the other way round. I want the "internal" event handler to fire first and based on some criteria in there (for instance the position of the mouse click) I may want to prevent the "external" event handler to fire.

I hope I'm making sense. Any help perhaps?