|
-
Dec 5th, 2003, 01:50 PM
#1
Thread Starter
Member
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.
-
Dec 5th, 2003, 08:53 PM
#2
Frenzied Member
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:
Private Sub fclsCallsLogger_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Deactivate
Dim x As Decimal
Do While Me.Opacity > 0.5
Me.Refresh()
Me.Opacity -= 0.05
For x = 1 To 100000
Next x
Loop
End Sub
-
Dec 6th, 2003, 05:20 PM
#3
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|