I have a button and upon mouseenter, a little form pops up, and upon mouseleave of the button, the little form disappears. I am needing this form to not accept any mouse events, in other words, be "invisible" to the mouse.
The problem is, the form pops up under the mouse, which triggers the mouseleave event for the button. I know there are other ways to get around this, but i'm needing the form to hide when the mouse leaves the original button that triggered the form, and I also need the form to appear underneath the mouse.
So how can I make the little pop-up form invisible to mouse-events, so that it doesn't cause the "mouse leave" event to trigger for the button?
The popup is of type "Form". Here is the mouseEnter and mouseLeave code that triggers showing and hiding the form:
private void btnPatientSearch_MouseEnter(object sender, EventArgs e)
{
_currentPatientInfo = new PatientInfo()
{
MdiParent = this.MdiParent
};
_currentPatientInfo.Show();
_currentPatientInfo.Location = new Point(181, 9);
}
}
private void btnPatientSearch_MouseLeave(object sender, EventArgs e)
{
if (_currentPatientInfo == null) return;
_currentPatientInfo.Hide();
_currentPatientInfo = null;
}