Private Sub Panel1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Panel1.MouseLeave
Dim pnl As Panel = CType(sender, Panel)
Dim rc As Rectangle = pnl.RectangleToScreen(pnl.ClientRectangle)
If Not rc.Contains(Cursor.Position) Then
pnl.Visible = False
Else
Debug.Print("MouseLeave() but cursor still within panel bounds")
End If
End Sub
|