Transitions, Effects for WinForms .NET

2

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?

    
asked by anonymous 28.04.2015 / 14:37

1 answer

1

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
    
28.04.2015 / 15:27