Got it by using this code:
Private Enum FormState
FadeIn
Pause
FadeOut
End Enum
Private Sub opacityTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opacityTimer.Tick
Select Case CurState
Case FormState.FadeIn
Me.Opacity += 0.07
If Me.Opacity >= 0.8 Then
Me.opacityTimer.Stop()
CurState = FormState.Pause
PreviousInterval = opacityTimer.Interval
opacityTimer.Interval = howLong
Me.opacityTimer.Start()
End If
Case FormState.Pause
Me.opacityTimer.Stop()
CurState = FormState.FadeOut
opacityTimer.Interval = PreviousInterval
Me.opacityTimer.Start()
Case FormState.FadeOut
Me.Opacity -= 0.08
If Me.Opacity <= 0 Then
Me.opacityTimer.Stop()
Form2.theNumOpened = Form2.theNumOpened - 1 'ADDED
Me.Close()
Me.Dispose()
End If
End Select
End Sub
:o)
David
StealthRT
2010-04-21 19:05:09