I am currently working on a subclass to the WinForms NumericUpDown Control. But because they built it so it contains multiple sub-controls, it messes up the MouseLeave and MouseEnter event.
When the mouse moves into the controls bounds, MouseEnter will fire followed by MouseExit when the mouse moves over one of the subcontrols (e.g. the Up and Down Arrow Buttons). In addition to that, MouseExit will not fire at all sometimes, especially likely when moving the mouse out of control bounds fast...
How can I get the events to fire properly or work around this problem?
EDIT:
Here's a simple code example:
public class TMNumericUpDownControl : NumericUpDown
{
public TMNumericUpDownControl()
{
MouseEnter += MouseEnterHandler;
MouseLeave += MouseLeaveHandler;
}
private void MouseEnterHandler(object sender, EventArgs e)
{
Debug.WriteLine("entered");
}
private void MouseLeaveHandler(object sender, EventArgs e)
{
Debug.WriteLine("Left");
}
}