标题:我弄了个窗体透明,但是会穿透的,请大神看下怎么使窗体透明而又不穿透。
取消只看楼主
mrye
Rank: 2
等 级:论坛游民
帖 子:14
专家分:36
注 册:2013-3-21
结帖率:100%
已结贴  问题点数:20 回复次数:1 
我弄了个窗体透明,但是会穿透的,请大神看下怎么使窗体透明而又不穿透。
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_Load()

Me.BackColor = &HF0000

Dim r As Long

BorderStyler = 0

r = GetWindowLong(hwnd, -20)

r = r Or &H80000

SetWindowLong hwnd, -20, r

SetLayeredWindowAttributes hwnd, &HFF0000, 0, &H1
搜索更多相关主题的帖子: 透明 
2013-03-24 15:20
mrye
Rank: 2
等 级:论坛游民
帖 子:14
专家分:36
注 册:2013-3-21
得分:0 
回复 3楼 lowxiong
谢谢斑竹了
2013-03-29 11:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-401769-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.512978 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved