Prova questo: ATTENZIONE, funziona solo con windows XP/2000
codice:
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "User32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2&
Public livello As Integer
Private Sub Form_Load()
'SOLO WIN XP/2000
Dim LEVEL As Byte
LEVEL = 0 '(da 0= completamente trasp. A 255= complt. solido)
livello = LEVEL
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(Me.hwnd, 0, LEVEL, LWA_ALPHA)
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim LEVEL As Byte
LEVEL = livello + 10 '(da 0= completamente trasp. A 255= complt. solido)
livello = LEVEL
If livello = 250 Then
LEVEL = 255
Timer1.Enabled = False
End If
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(Me.hwnd, 0, LEVEL, LWA_ALPHA)
End Sub
Modificando i due valori che ho segnato in rosso puoi accelerare o decelerare la "materializzazione" del form...