Support Forums
[Tutorial] Fade In / Out Form [Source] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [Tutorial] Fade In / Out Form [Source] (/showthread.php?tid=23443)



[Tutorial] Fade In / Out Form [Source] - ₠o™ - 11-25-2011

Hello SF!
Today I will show you the said subject.

In your Form, Select the Two Timers i.e timer1 and time2. Set the properties as below

timer1 > Enabled = true , Timer = 1
timer2 > Enabled = false , Timer = 1



In your exit application button, use this code...

Code:
private void btnExitApplication_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = true;
        }


Now Double click on timer1 and timer2 respectively and add this code.

Code:
private void timer1_Tick(object sender, EventArgs e)
        {
            Opacity += 0.03;
            if (Opacity == 100)
            {
                timer1.Enabled = false;
            }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            Opacity -= 0.03;
            if (Opacity == 0)
            {
                ProjectData.EndApp();
            }
        }

In your Form, Select Opacity = 0%

Thats it!! Tell me how is this work?
Hope you like it.

Regards



RE: [Tutorial] Fade In / Out Form [Source] - Professor Oak - 12-01-2011

Thanks for this, very helpful. Smile


RE: [Tutorial] Fade In / Out Form [Source] - ThePrinCe - 12-02-2011

Code:
Private Sub btnExitApplication_Click(sender As Object, e As EventArgs)
    timer1.Enabled = False
    timer2.Enabled = True
End Sub

Code:
Private Sub timer1_Tick(sender As Object, e As EventArgs)
    Opacity += 0.03
    If Opacity = 100 Then
        timer1.Enabled = False
    End If
End Sub

Private Sub timer2_Tick(sender As Object, e As EventArgs)
    Opacity -= 0.03
    If Opacity = 0 Then
        ProjectData.EndApp()
    End If
End Sub



RE: [Tutorial] Fade In / Out Form [Source] - HostGap - 12-03-2011

Thanks a great deal for this buddy, I have bookmarked this page.


RE: [Tutorial] Fade In / Out Form [Source] - ₠o™ - 12-09-2011

Thanks for your feedback.
REgards with best wishes