You are missing the declaration for AnimateWindow.
Here is your code corrected:
Code:Public Class Form1 Public Declare Auto Function AnimateWindow Lib "user32" (ByVal hwnd As IntPtr, ByVal time As Integer, ByVal flags As Integer) As Boolean Public Enum AnimateStyles Slide = 262144 Activate = 131072 Blend = 524288 Hide = 65536 Center = 16 HOR_Positive = 1 HOR_Negative = 2 VER_Positive = 4 VER_Negative = 8 End Enum Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click AnimateWindow(ChildForm1.Handle, 1000, AnimateStyles.HOR_Negative Or AnimateStyles.Blend) ChildForm1.ShowDialog(); End Sub End Class




Reply With Quote