Click here to Skip to main content
16,008,954 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello.
Excuse example of the animation click on form
Thanks Abbasi.
Posted

Your best bet is to use WPF. Otherwse, you need to use a timer and every tick of the timer, move your form object closer to where you want it to be.
 
Share this answer
 
Private button1 As Button
Private components As IContainer = Nothing
Private tm As Timer = New Timer

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
MyBase.Left = (Screen.PrimaryScreen.WorkingArea.Width - MyBase.Width)
MyBase.Top = (Screen.PrimaryScreen.WorkingArea.Height - MyBase.Height)
Me.tm.Enabled = False
Me.tm.Interval = 20
AddHandler Me.tm.Tick, Function
If (MyBase.Width < 500) Then
Form1.MoveWindow(MyBase.Handle, (MyBase.Left - 5), (MyBase.Top - 5), (MyBase.Width + 5), (MyBase.Height + 5), True)
Else
Me.tm.Enabled = False
End If
End Function
End Sub

<dllimport("user32.dll",> _
Friend Shared Function MoveWindow(ByVal hWnd As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Boolean) As Boolean
End Function
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900