Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mouse event fires when I mouse over child control

Ok, so I have this control that has some other controls on it.

control with controls on it

I have set the controls mouse enter and mouse leave events. My problem is that the mouse leave event fires if I mouse over any of the child controls (like the name box for example).

What I need is for the mouse leave event to fire when my mouse leaves the entire control, rather than firing when I mouse over any of the child controls. Any suggestions?

Here are the events as I have them so far:

Private Sub DeliveryControl_MouseEnter(sender As System.Object, e As System.EventArgs) Handles MyBase.MouseEnter
    Me.removeImage.Visible = True
End Sub

Private Sub DeliveryControl_MouseLeave(sender As System.Object, e As System.EventArgs) Handles MyBase.MouseLeave
    Me.removeImage.Visible = False
End Sub
like image 628
Johnie Karr Avatar asked Oct 18 '25 11:10

Johnie Karr


1 Answers

This question may address your problem. Basically you work out whether your mouse is over a child control or not using GetChildAtPoint.

like image 185
Simon Avatar answered Oct 21 '25 03:10

Simon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!