VB 08 Form Fade

Published

Introduction: VB 08 Form Fade

About: I like to take things apart, see how they work, then put them back together; Or mod them to do other things. My hobbies are fulfilled with electronics, computers, making things, and lots of other things that...

VB 08 Form Fade Video

This is a video I made some time ago (Using Microsoft Visual Basic 2008 Express edition)

showing "HOW I MADE" a Visual Basic Form fade in & out.

Thank you for watching!

I will try to post a sample code soon.

I've since updated to Microsoft Visual Basic 2010 Express Edition.

Upon checking the latest version is Visual Studio Express 2013

Step 1: Form1 Code

Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

ProgressBar1.Increment(+10)

'The higher the increment the faster it will change/fade 'my increment is set to 10 so each time it changes 'my opacity level changes to the corrisponding value

If ProgressBar1.Value = 100 Then Me.Opacity = 1 ProgressBar1.Value = 0 'reset the progress bar to zero

ElseIf ProgressBar1.Value = 90 Then Me.Opacity = 0.9 ElseIf ProgressBar1.Value = 80 Then Me.Opacity = 0.8 ElseIf ProgressBar1.Value = 70 Then Me.Opacity = 0.7 ElseIf ProgressBar1.Value = 60 Then Me.Opacity = 0.6 ElseIf ProgressBar1.Value = 50 Then Me.Opacity = 0.5 ElseIf ProgressBar1.Value = 40 Then Me.Opacity = 0.6 ElseIf ProgressBar1.Value = 30 Then Me.Opacity = 0.7 ElseIf ProgressBar1.Value = 20 Then Me.Opacity = 0.8 ElseIf ProgressBar1.Value = 10 Then Me.Opacity = 0.9

End If End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click 'click this label to toggle the fade on -OR- Off

If Timer1.Enabled = True Then Label1.Text = "Form fade is Off" Timer1.Stop() ElseIf Timer1.Enabled = False Then Label1.Text = "Form fade is On" Timer1.Start() End If End Sub End Class

Share

    Recommendations

    • Creative Misuse Contest

      Creative Misuse Contest
    • Clocks Contest

      Clocks Contest
    • Oil Contest

      Oil Contest

    3 Discussions

    0
    user
    cswin

    3 years ago

    Hello