Attribute VB_Name = "Alpha" 'Alpha Fun ------------------------------------------------------- Const LWA_COLORKEY = &H1 Const LWA_ALPHA = &H2 Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 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 m_Value As Integer Dim mm_Value As String Public Function Value() As String Value = mm_Value End Function Public Function SetAlpha(IntAlpha As Integer, Frm As Form) 'Alpha ********************************************* Dim Ret As Long 'Set the window style to 'Layered' Ret = GetWindowLong(Frm.hWnd, GWL_EXSTYLE) Ret = Ret Or WS_EX_LAYERED SetWindowLong Frm.hWnd, GWL_EXSTYLE, Ret 'SetLayeredWindowAttributes Frm.hWnd,0,(0-255),LWA_ALPHA SetLayeredWindowAttributes Frm.hWnd, 0, 0, LWA_ALPHA '******************************************************* SetLayeredWindowAttributes Frm.hWnd, 0, CByte(IntAlpha), LWA_ALPHA m_Value = Int((IntAlpha * 100) / 255) mm_Value = "% " & m_Value End Function