4

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
Johnie Karr
  • 2,744
  • 2
  • 35
  • 44

1 Answers1

3

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

Community
  • 1
  • 1
Simon
  • 6,062
  • 13
  • 60
  • 97