[Tutorial] How to have a fade in effect when a App Closes
double click on ur form then this should show up
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
then unerneath it add this:
Code:
For FadeIn = 0.0 To 1.1 Step 0.1
Me.Opacity = FadeIn
Me.Refresh()
Threading.Thread.Sleep(100)
Next
then underneath that Code add this
Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
For FadeOut = 90 To 10 Step -10
Me.Opacity = FadeOut / 100
Me.Refresh()
Threading.Thread.Sleep(50)
Next
End
End Sub
Debug it and it should fade in when u run it and fade out when u close it.
Edit= u have to build the project there might be an error if u debug it from VB
Hmm. It's weird how on a Google Search I was able to find several pages with the exact same code.
Agreed, A few Website have this code posted exactly , And considering this can be achieved with a few methods, the fact that these match exactly make this "tutorial" questionable, However, This is not a Tutorial, Really should be a snippet, So I am going to close this, I will allow you to post it in the snippets vault, if you give credit.
Anything questionable will be closed as well.
/Closed