08-21-2010, 06:28 AM
The following is an example of how to increase the height of your form & decrease it back to the original size (This example uses a form where Height = 222, and will be increased to Height = 250).
Imports:
Function:
Using:
Timer1:
Timer2:
This is a really cool effect to add to your applications. Hope you all like it.
Imports:
Code:
Imports System.Runtime.InteropServices
Function:
Code:
<DllImport("user32.dll", SetLastError:=True)> _
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
Using:
Code:
If Me.Height < 250 Then
Timer1.Start()
Else
Timer2.Start()
End If
Timer1:
Code:
If (MyBase.Width < 500) Then
Form1.MoveWindow(MyBase.Handle, (MyBase.Left - 0), (MyBase.Top - 0), (MyBase.Width + 0), (MyBase.Height + 2), True)
If Me.Height = 250 Then
Me.Timer1.Enabled = False
End If
End If
MsgBox("Extended!")
Timer2:
Code:
If (MyBase.Width < 500) Then
Form1.MoveWindow(MyBase.Handle, (MyBase.Left - 0), (MyBase.Top - 0), (MyBase.Width + 0), (MyBase.Height - 2), True)
If Me.Height = 222 Then
Me.Timer2.Enabled = False
End If
End If
MsgBox("Retracted!")
This is a really cool effect to add to your applications. Hope you all like it.