vb6 如何使窗体半透明话。详解,复制粘贴党后退,我是小白,最好详细一点。

我是小白58885596... 我是小白58885596 展开
 我来答
保密国度
2012-06-27 · 超过10用户采纳过TA的回答
知道答主
回答量:44
采纳率:0%
帮助的人:15万
展开全部
'通用声明 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
风雪剑无痕
2012-06-27 · TA获得超过1253个赞
知道大有可为答主
回答量:1691
采纳率:100%
帮助的人:1679万
展开全部
'通用声明
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

不复制不粘贴难道让我手输哇!
追问
看错了- -,对不起勒。。下次采用你的,嘿嘿,我以为他回答的早呢
追答
呵呵,真正的复制粘贴党倒是前进了,没关系~
回答的早和晚不是确定问题答案的重要依据,要注意这一点
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式