Results 1 to 3 of 3

Thread: Splash Screen with fade in and fade out

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2003
    Location
    Portugal
    Posts
    49

    Splash Screen with fade in and fade out

    Can someone tell me where can i put some code to make a splash screen with fade in and fade out ?

    i tried to put the code inside the Form_Load event, but it won´t work.


  2. #2
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    here is a routine I wrote so that my form will fade when it loses focus to another window. Adapt it so that it can be used in your app. the key is to use the "deactivate" and "activate" events. Let me know if you still need help.

    VB Code:
    1. Private Sub fclsCallsLogger_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Deactivate
    2.  
    3. Dim x As Decimal
    4.         Do While Me.Opacity > 0.5
    5.             Me.Refresh()
    6.             Me.Opacity -= 0.05
    7.             For x = 1 To 100000
    8.             Next x
    9.         Loop
    10.     End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2003
    Location
    Portugal
    Posts
    49
    Many thanks ThePhantom, i just got it and with a Pause command:



    Imports Microsoft.VisualBasic.DateAndTime

    Public Class Form1

    Inherits System.Windows.Forms.Form

    #Region " Windows Form Designer generated code "

    Sub Pause(ByVal Segundos_de_Pausa As Byte)
    REM Faz uma pausa na execução da Aplicação.
    REM A Função "Timer" pertence ao Módulo "Microsoft.VisualBasic.DateAndTime", e, indica o tempo decorrido desde a Meia-Noite.
    Dim Tempo_Final As Double
    Tempo_Final = Timer + Segundos_de_Pausa
    Do While Timer < Tempo_Final
    Loop
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    REM Carrega a "Form1" para a memória e para o ecrán.
    Dim I As Double
    Me.Show()
    'Cria um Splash Screen com Fade In - Fade Out.
    For I = 0 To 1 Step 0.01
    Me.Opacity = I
    Next I
    Call Pause(5)
    For I = 1 To 0 Step -0.01
    Me.Opacity = I
    Next I
    Me.Hide()
    Call Pause(2)
    Me.BackgroundImage = Nothing
    Me.BackColor = BackColor.SlateGray
    Me.Show()
    For I = 0 To 1 Step 0.01
    Me.Opacity = I
    Next I
    End Sub

    End Class


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width