Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sliding Animation
#2
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.

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!
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Sliding Animation - by zmanalpha - 02-19-2012, 04:40 PM
Re: Sliding Animation - by brandonio21_phpbb3_import2 - 02-20-2012, 11:54 AM
Re: Sliding Animation - by zmanalpha - 02-20-2012, 01:40 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)