Private Sub frmDiv_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
For i As Integer = 1 To 100
Me.Opacity = i / 100
Threading.Thread.Sleep(10)
Application.DoEvents()
Next
End Sub
Start with setting Opacity property for form to 0 in designer.
Do the opposite in FormClosing event. (For 100 To 1 Step -1)VB.NET:Private Sub frmDiv_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown For i As Integer = 1 To 100 Me.Opacity = i / 100 Threading.Thread.Sleep(10) Application.DoEvents() Next End Sub
FormAnimation.FormAnimator fa = New FormAnimation.FormAnimator(YOUR_FORM_OBJECT, FormAnimation.FormAnimator.AnimationMethod.Blend, 250)
There are different API functions that can be used to make same effect, but you may be thinking of AnimateWindow Function ? This also has other effects.the Windows API has the ability to do this