请教各位老师透明窗体,控件不透明的问题
请教各位老师下面的代码在xp系统中运形时窗体黑闪现象呢,就是在窗体启动时黑闪一次,在透明,什么原因呢,请高手指点谢谢Option Explicit
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 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
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1
Private Sub Form_Load()
Me.BackColor = RGB(88, 88, 88)
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, RGB(88, 88, 88), 255, LWA_ALPHA Or LWA_COLORKEY
End Sub