ciao Magicolotto,
prova questa funzione dovrebbe fare al caso tuo.
codice:
Option Explicit
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_RIGHT As Long = &H1000
Private Const WS_EX_LEFTSCROLLBAR As Long = &H4000
Private Const WS_EX_LAYERED As Long = &H80000
Private Const WS_EX_TRANSPARENT = &H20&
Private Const LWA_COLORKEY As Long = &H1
Private Const LWA_ALPHA As Long = &H2
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 crKey As Long, _
ByVal bAlpha As Long, _
ByVal dwFlags As Long) As Long
Private Sub Form_Load()
Call formtrasparente
End Sub
Private Function formtrasparente()
Dim style As Long
Dim alpha As Integer
alpha = 120 ' setta trasparenza form (0 - 255)
style = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
If Not (style And WS_EX_LAYERED = WS_EX_LAYERED) Then
style = style Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, style
SetLayeredWindowAttributes Me.hwnd, 0&, alpha, LWA_ALPHA
End If
End Function