Results 1 to 3 of 3
  1. #1
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310

    Red face Fade your program

    Okay this is a tutorial on how to fade your application. (Very simple)

    also im going to put this code in a module cus its cleaner that way

    1. Make a new application

    2. Add a Module and add this code:


    Code:
        Public Sub fadein()
            Dim F As Double
            For F = 0.0 To 1.1 Step 0.1
                Form1.Opacity = F
                Form1.Refresh()
                Threading.Thread.Sleep(100)
            Next
        End Sub
        Public Sub fadeout()
            Dim FO As Double
            For FO = 1.1 To 0.0 Step -0.1
                Form1.Opacity = FO
                Form1.Refresh()
                Threading.Thread.Sleep(100)
            Next
        End Sub
    3. Add this code to the Forum_Load

    Code:
    fadein()
    4. Add this code to the Forum_Closed

    Code:
    fadeout()

    TaDah! your done! easy right?
    __________________________________________________ __________________________________________________ __
    you can also dink around with a Trackbar

    say you make it maximum of 5

    then you just add this code:


    Code:
    If TrackBar1.Value = 5 Then
                Me.Opacity = 0.5
            End If
            If TrackBar1.Value = 4 Then
                Me.Opacity = 0.6
            End If
            If TrackBar1.Value = 3 Then
                Me.Opacity = 0.7
            End If
            If TrackBar1.Value = 2 Then
                Me.Opacity = 0.8
            End If
            If TrackBar1.Value = 1 Then
                Me.Opacity = 0.9
            End If
            If TrackBar1.Value = 0 Then
                Me.Opacity = 1
            End If
    the numbers can be what you want them to be 0 - 1, i wouldnt recommend going below 0.01 or it may not let you click on the application anymore

    and so when you scroll left to right it fades in or out depending on which way you move it.

    __________________________________________________ __________________________________________________ __

    Also you can make just a regular hide button and put this code so if you press it again it comes back:

    Code:
            If Me.Opacity = 1 Then
                Me.Opacity = 0.01
            Else
                Me.Opacity = 1
            End If
    Last edited by guza44_44; 10-18-2009 at 09:52 PM.
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  2. The Following User Says Thank You to guza44_44 For This Useful Post:

    Lolland (10-18-2009)

  3. #2
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Nice tut man. I appreciate it, I was looking on how to do this earlier.

  4. #3
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    this is noob but, How do i get the form closing?

    did it on startup and it lagged. Dont like it xD
    Last edited by ac1d_buRn; 10-21-2009 at 03:28 AM.

Similar Threads

  1. [Tut]Merging .dlls into your program
    By Blubb1337 in forum Visual Basic Programming
    Replies: 12
    Last Post: 10-28-2010, 09:27 AM
  2. How to make your program minimize into the task bar?
    By deathninjak0 in forum Visual Basic Programming
    Replies: 8
    Last Post: 11-29-2009, 05:01 AM
  3. [INFO] Make your Program automatically run as Administrator in VB08
    By CoderNever in forum Visual Basic Programming
    Replies: 13
    Last Post: 11-24-2009, 08:06 PM
  4. Replies: 6
    Last Post: 11-16-2009, 08:53 PM
  5. [TuT]Preventing your Program from Closing
    By Iamazn in forum Visual Basic Programming
    Replies: 4
    Last Post: 09-09-2009, 06:10 PM

Tags for this Thread