Hello everybody,

I am trying to make a sliding menu using a panel. I set up a form a new panel with size: 181,107, location 180,-95 and the following code:

Private Sub Panel1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Panel1.MouseEnter
For i = -95 To 0
Panel1.Location = New Point(180, i)
Threading.Thread.Sleep(1)
Next
End Sub

Private Sub Panel1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Panel1.MouseLeave
For i = 0 To 95
Panel1.Location = New Point(180, -i)
Threading.Thread.Sleep(1)
Next
End Sub

It works fine until I add a control to the panel. If I add any control and the mouse gets over that control it doesn't work any more and it goes up and down. I assume that when mouse enters the controls then the mouse leave of the panel is activated.

Any idea to make it work?

thx