View Poll Results: Did this tutorial help you?

Voters
9. This poll is closed
  • Yes it did! Thanks

    4 44.44%
  • No it didn't.

    5 55.56%
Results 1 to 5 of 5
  1. #1
    K4GE's Avatar
    Join Date
    Mar 2009
    Gender
    male
    Posts
    311
    Reputation
    13
    Thanks
    65
    My Mood
    Inspired

    Thumbs up [Tutorial] fade in/out effect

    Hi, and welcome to my first tiny Visual Basic.Net tutorial.
    In this tutorial i will show you how to let a form fade in and out.

    First off all, you need to open Microsoft Visual Basic 2008 Express Edition and start a new Windows Form Application.

    Now that you have made your form,
    you will need to place a button. (for the fade out effect)
    After you are done, your form should look like this:

    Now double click your form and you should get this:

    Now you have to put
    Code:
            Dim fadeinout As Double
            For fadeinout = 0 To 1.01 Step 0.01
                Me.Opacity = fadeinout
                  Next
    between

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        End Sub
    End Class
    so you should get this:

    Now press the 'Debug Button' to see the fade in effect:

    and now your Form1 should fade in when you start it.

    Now lets do the fade out effect with the button.(This can also be done for closing the form, but ill stick with the button for now)

    You should have the folowing code atm:
    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim fadeinout As Double
            For fadeinout = 0 To 1.01 Step 0.01
                Me.Opacity = fadeinout
            Next
        End Sub
    End Class
    Now double click your Button1 and this should appear
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
        End Sub
    End Class
    Put
    Code:
            Dim fadeout As Double
            For fadeout = 1 To 0 Step -0.001
                Me.Opacity = fadeout
            Next
    Between:
    Code:
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
        End Sub
    End Class
    And now you should have:
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim fadeout As Double
            For fadeout = 1 To 0 Step -0.001
                Me.Opacity = fadeout
            Next
        End Sub
    End Class
    Now press the debug button again.

    And now your form will fade in and out!
    I hope this tutorial helped you.

  2. #2
    u1111u's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    uk
    Posts
    262
    Reputation
    9
    Thanks
    49
    My Mood
    Buzzed
    nothinck happens
    Joe06 Backup

  3. #3
    Lukas59's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Location
    Linz
    Posts
    2,197
    Reputation
    14
    Thanks
    306
    My Mood
    Amazed
    u only can´t see the button and the form 1 but nothing otheer happenz

  4. #4
    almog6666's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    280
    Reputation
    10
    Thanks
    128
    My Mood
    Fine
    Ammm it works BUT
    When u click On the button.
    The project gone
    then
    u cant close it
    so its unusefull
    Dident Helped Sorry

  5. #5
    alghamdi29's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Saudi Arabia
    Posts
    50
    Reputation
    10
    Thanks
    18
    My Mood
    Cold
    it worked for me

    that is a cool tut u got there

Similar Threads

  1. [Tutorial]{UI Realated} How to have a fade in effect when a App Closes
    By hopefordope in forum Visual Basic Programming
    Replies: 4
    Last Post: 03-09-2010, 05:00 PM
  2. Fade In/Out Effect
    By creationsbrodcast in forum Visual Basic Programming
    Replies: 26
    Last Post: 01-18-2010, 09:23 PM
  3. In-Depth Tutorial (*Blacked out Weapons*)
    By gudsoldier in forum Combat Arms Hacks & Cheats
    Replies: 85
    Last Post: 07-08-2009, 02:38 AM
  4. [Tutorial]Enabling the blood effect
    By Andyklk2009 in forum Combat Arms Hacks & Cheats
    Replies: 23
    Last Post: 08-29-2008, 10:04 PM
  5. Render Pop-Out Tutorial
    By Bull3t in forum Tutorials
    Replies: 15
    Last Post: 07-05-2006, 10:46 PM

Tags for this Thread