02-20-2012, 11:54 AM
This code assumes that your Panel is called PNL.
So, here's the basic idea. You want to add a timer to your form with the interval of around 50. Then, insert something like this code.
Hopefully this helps. Please note that there may be better ways to do this (Like using only one timer), but I just wrote down the first way that came to mind!
So, here's the basic idea. You want to add a timer to your form with the interval of around 50. Then, insert something like this code.
Code:
Sub hover() handles PNL.MouseEnter
Timer2.Stop()
Timer2.Enabled = False
Timer1.Start()
Timer1.Enabled = True
End Sub
Sub leave() handles PNL.MouseLeave
Timer1.Stop()
Timer1.Enabled = False
Timer2.Start()
Timer2.Enabled = True
End Sub
Sub OpenTimerTick handles Timer1.Tick
If PNL.Height < 150
PNL.Height += 5
End If
End Sub
Sub CloseTimerTick handles Timer2.Tick
If PNL.Height > 0
PNL.Height -= 5
End If
End Sub
Hopefully this helps. Please note that there may be better ways to do this (Like using only one timer), but I just wrote down the first way that came to mind!