Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 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
Private Sub Form_Activate() Dim lCount As Long Do While lCount < 255 lCount = (lCount + 1) DoEvents SetLayeredWindowAttributes Me.hWnd, 0, lCount, LWA_ALPHA Loop End Sub
Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE) lStyle = lStyle Or WS_EX_LAYERED SetWindowLong Me.hWnd, GWL_EXSTYLE, lStyle End Sub
Private Sub Form_Unload(Cancel As Integer) Dim lCount As Long lCount = 255 Do While lCount > 0 lCount = (lCount - 1) DoEvents SetLayeredWindowAttributes Me.hWnd, 0, lCount, LWA_ALPHA Loop End Sub '--------------------------- Form1 ---------------------------
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.