| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 396 人关注过本帖
标题:如何使窗体透明
只看楼主 加入收藏
sun1989217
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-9
收藏
 问题点数:0 回复次数:1 
如何使窗体透明
各位高手,请问如何使窗体透明,请写一个具体事例,谢谢
搜索更多相关主题的帖子: 窗体 事例 
2007-05-19 15:32
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
收藏
得分:0 

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
Private Const LWA_COLORKEY = &H1

Private Sub Form_Load()
Dim rtn As Long

Me.BackColor = RGB(255, 255, 255)
BorderStyler = 0
rtn = GetWindowLong(hWnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hWnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hWnd, RGB(255, 255, 255), 100, LWA_COLORKEY

End Sub
这里用到的是VB API函数!

2007-05-19 15:47
快速回复:如何使窗体透明
数据加载中...
 
   



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

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