How to get the effects of fade-in and out, transitions, moves, and so on, in forms and their controls in VB.NET, natively or with FrameWorks?
How to get the effects of fade-in and out, transitions, moves, and so on, in forms and their controls in VB.NET, natively or with FrameWorks?
The Opacity
"of the form to achieve this effect. Here's an example :
Public Sub fadeIn()
For fade = 0.0 To 1.1 Step 0.1
Me.Opacity = fade
Me.Refresh()
Threading.Thread.Sleep(100)
Next
End Sub
Public Sub fadeOut()
For fade = 90 To 10 Step -10
Me.Opacity = fade / 100
Me.Refresh()
Threading.Thread.Sleep(50)
Next
End Sub
In events Form1_Load
and Form1_FormClosing
you do:
Private Sub Form1_Load(sender As Object, e As EventArgs)
Handles MyBase.Load
fadeIn()
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs)
Handles MyBase.FormClosing
fadeOut()
End Sub