Controle

cs_Habich Messages postés 6 Date d'inscription jeudi 24 février 2005 Statut Membre Dernière intervention 4 mars 2005 - 24 févr. 2005 à 18:54
cs_Habich Messages postés 6 Date d'inscription jeudi 24 février 2005 Statut Membre Dernière intervention 4 mars 2005 - 25 févr. 2005 à 10:21
comment rendre une feuille portant arrière plan (image) transparente, et qu'elle soit visible (avec ses contrôle )

2 réponses

Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
24 févr. 2005 à 19:13
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = -20

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 Byte, ByVal dwFlags As Long) As Long

Dim Ret As Long
Dim Couleur As Long


Ret = GetWindowLong(Form1.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Form1.hWnd, GWL_EXSTYLE, Ret


' opacity = 128
SetLayeredWindowAttributes Form1.hWnd, 0, 128, LWA_ALPHA

' opacité ou transparence mais pas les deux

' transparence pour Couleur = RGB(Bleu,Vert,Bleu)
SetLayeredWindowAttributes Form1.hWnd, Couleur, 0, LWA_COLORKEY

Daniel
0
cs_Habich Messages postés 6 Date d'inscription jeudi 24 février 2005 Statut Membre Dernière intervention 4 mars 2005
25 févr. 2005 à 10:21
Merci Daniel, c'est ça que je veux.
0
Rejoignez-nous