prog1001 | je peut te dire comment rendre ta forme transparente de 0% à 100% si tu veux ! mais un effet de fondu, je vois pas !
met ça dans un module et appelle la Sub :
Code :
- Option Explicit
- Global Const WS_EX_LAYERED = &H80000
- Global Const LWA_COLORKEY = &H1
- Global Const LWA_ALPHA = &H2
- Global Const GWL_EXSTYLE = (-20)
- Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Boolean
- Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
- Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
- Public Sub Trans(Stat As String, Fenêtre As Form, Optional ByVal Alpha As Byte = 255)
- Select Case UCase(Stat)
- Case "ON"
- SetWindowLong Fenêtre.hWnd, GWL_EXSTYLE, GetWindowLong(Fenêtre.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
- SetLayeredWindowAttributes Fenêtre.hWnd, 0, Alpha, LWA_ALPHA
- Case "OFF"
- SetWindowLong Fenêtre.hWnd, GWL_EXSTYLE, GetWindowLong(Fenêtre.hWnd, GWL_EXSTYLE) - WS_EX_LAYERED
- Case "SET"
- SetLayeredWindowAttributes Fenêtre.hWnd, 0, Alpha, LWA_ALPHA
- End Select
- End Sub
|
et ça marche avec borderstyle=0
j'ai chopé ça sur vbfrance mais je sais plus ou !
|