¿Puede SetLayeredWindowAttributesce VB hacer que el control sea transparente?
Dibuje un HScroll en el formulario, Max = 250, Min = 1, valor = 200
Dibuje un temporizador, Intervalo = 500
HScroll se usa para ajustar la transparencia, 250 es opaco.
El código es el siguiente:
Función de declaración privada SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) Siempre
Función de declaración privada GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) Siempre
Const privada GWL_EXSTYLE = -20
Const privada LWA_ALPHA mientras = &H2
Const privada WS_EX_LAYERED Mientras = &.H8000
Función de declaración privada SetLayeredWindowAttributes Lib "user32 " (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Long, ByVal dwflags As Long) As Long
Private Sub Timer1_Timer()
Atenuar FAttri As Long
FAttri = GetWindowLong(Me.
p>Llamar a SetWindowLong(Me.hwnd, GWL_EXSTYLE, FAttri o WS_EX_LAYERED)
Llamar a SetLayeredWindowAttributes(Me.hwnd, 0, HScroll1.Value, LWA_ ALPHA)
End Sub
Si no funciona escribe un email y te lo envía