Ciao a tutti in rete ho trovato questo codice che rende un form (e tutti i suoi controlli opaco)
Ma nel caso in cui vorrei rendere solo il colore di sfondo del form ? e lasciare intatti i controlli che potrei fare ?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() Dim Ret As Long Ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE) Ret = Ret Or WS_EX_LAYERED SetWindowLong Me.hwnd, GWL_EXSTYLE, Ret SetLayeredWindowAttributes Me.hwnd, 0, 128, LWA_ALPHA End Sub

Rispondi quotando
