2个回答
展开全部
'通用声明 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 Const WS_EX_LAYERED = &H80000 Private Const GWL_EXSTYLE = (-20)Private Const LWA_ALPHA = &H2 Dim lStyle As Long '点击按钮使窗体透明 Private Sub Command1_Click() lStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE) lStyle = lStyle Or WS_EX_LAYERED SetWindowLong Me.hWnd, GWL_EXSTYLE, lStyle SetLayeredWindowAttributes Me.hWnd, 0, 100, LWA_ALPHA '参数100为透明度,范围0~255 End Sub
展开全部
'通用声明
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 Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Dim lStyle As Long
'点击按钮使窗体透明
Private Sub Command1_Click()
lStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
lStyle = lStyle Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, lStyle
SetLayeredWindowAttributes Me.hWnd, 0, 100, LWA_ALPHA '参数100为透明度,范围0~255
End Sub
不复制不粘贴难道让我手输哇!
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 Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Dim lStyle As Long
'点击按钮使窗体透明
Private Sub Command1_Click()
lStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
lStyle = lStyle Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, lStyle
SetLayeredWindowAttributes Me.hWnd, 0, 100, LWA_ALPHA '参数100为透明度,范围0~255
End Sub
不复制不粘贴难道让我手输哇!
追问
看错了- -,对不起勒。。下次采用你的,嘿嘿,我以为他回答的早呢
追答
呵呵,真正的复制粘贴党倒是前进了,没关系~
回答的早和晚不是确定问题答案的重要依据,要注意这一点
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询