C
cb.brite
Hello,
I have tried this using the MouseEnter/MouseLeave events. However these
events do not really refer to the rectangular shape of the form, but
the client area (form area minus children areas). This means that if
the mouse is currently inside the form's client area and it enters a
child, a MouseLeave event will be generated on the form.
One little trick to overcome this is to do a point-in-rectangle test
inside the MouseLeave handler:
if (!Bounds.Contains(MousePosition))
{
// mouse really left the form
}
This however doesn't always work, for example if you have another
window on top of yours, because that window's area will be treated just
like a child area.
Anyone knows how to do this cleanly?
Thanks in advance,
Cosmin.
I have tried this using the MouseEnter/MouseLeave events. However these
events do not really refer to the rectangular shape of the form, but
the client area (form area minus children areas). This means that if
the mouse is currently inside the form's client area and it enters a
child, a MouseLeave event will be generated on the form.
One little trick to overcome this is to do a point-in-rectangle test
inside the MouseLeave handler:
if (!Bounds.Contains(MousePosition))
{
// mouse really left the form
}
This however doesn't always work, for example if you have another
window on top of yours, because that window's area will be treated just
like a child area.
Anyone knows how to do this cleanly?
Thanks in advance,
Cosmin.