Reputation: 21
I want to create a menu wherein i can hover the titles and the contents will be displayed below but the thing is the panel also dissapear when i mouseleave
Private Sub Label10_MouseLeave(sender As Object, e As EventArgs) Handles Panel9.MouseLeave, Label10.MouseLeave
Dim x As New Point
x = MousePosition
If x = Panel7.Location Then
Else
Panel9.BackColor = Color.FromArgb(150, Color.White)
Panel7.Visible = False
End If
End Sub
Upvotes: 0
Views: 99
Reputation: 368
To determine whether your mouse is over a specified control, just do:
If myControl.ClientRectangle.Contains(myControl.PointToClient(Control.MousePosition)) Then
' Mouse over control
Else
' Mouse not over control
End If
Whereas you replace myControl
with any control you'd wish to check whether your mouse is over it.
Upvotes: 1