Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello,
I'm trying put some animation effects in my windows form application. here is my code:-
VB
Private Const AW_BLEND = &H80000  'Uses a fade effect. This flag can be used only if hwnd is a top-level window.
   Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Int32, ByVal dwTime As Int32, ByVal dwFlags As Int32) As Boolean
   Dim winHide As Integer = &H10000
   Dim winBlend As Integer = &H80000


and in the formclosing event:-

VB
Private Sub add_branch_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
       AnimateWindow(Me.Handle.ToInt32, CInt(1200), winHide Or winBlend)
       e.Cancel = False
   End Sub


This's not working , if I'm making this form as a child of my MDI form,i.e.
VB
Private Sub AddBranchToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddBranchToolStripMenuItem.Click

       add_branch.Show()
       add_branch.MdiParent = Me
   End Sub

It works without making it a child for the MDI,but How can I implement the animation with making the form as a child becoz if's not a child, then i'm loosing the form by clicking outside. I can't use showDialog().

Thankx for help....
Posted

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