没有合适的资源?快使用搜索试试~ 我知道了~
vb透明的代码先添加time噢~
需积分: 3 1 下载量 59 浏览量
2010-06-02
18:55:56
上传
评论
收藏 2KB TXT 举报
温馨提示
试读
3页
先添加一个time控件再打代码 系统要求要多打字 系统要求要多打字 系统要求要多打字 系统要求要多打字
资源推荐
资源详情
资源评论
'----------------------------------------------------------------------------------
'这是一段让VB的程序窗口淡入淡出的程序
'希望大家喜欢,并继续展示VB的魅力
'要2K以上系统才可以看到效果
' 作者:李云轩
'请尽量保留此信息,尊重他人的所有权
'----------------------------------------------------------------------------------
Option Explicit
'定义全局变量
Dim rtn As Long
'API声明
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 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
Dim Color, Mid As Integer
Private Sub Form_Load()
Color = 5 '初始化透明度
Mid = 5 '透明度为5的差值减弱
Timer1.Interval = 5 'Timer控件的间隔时间(此数值越大渐变效果越慢)
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE) '取的窗口原先的样式
rtn = rtn Or WS_EX_LAYERED '使窗体添加上新的样式WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, rtn '把新的样式赋给窗体
SetLayeredWindowAttributes Me.hwnd, 0, 0, LWA_ALPHA
'这是一段让VB的程序窗口淡入淡出的程序
'希望大家喜欢,并继续展示VB的魅力
'要2K以上系统才可以看到效果
' 作者:李云轩
'请尽量保留此信息,尊重他人的所有权
'----------------------------------------------------------------------------------
Option Explicit
'定义全局变量
Dim rtn As Long
'API声明
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 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
Dim Color, Mid As Integer
Private Sub Form_Load()
Color = 5 '初始化透明度
Mid = 5 '透明度为5的差值减弱
Timer1.Interval = 5 'Timer控件的间隔时间(此数值越大渐变效果越慢)
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE) '取的窗口原先的样式
rtn = rtn Or WS_EX_LAYERED '使窗体添加上新的样式WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, rtn '把新的样式赋给窗体
SetLayeredWindowAttributes Me.hwnd, 0, 0, LWA_ALPHA
资源评论
chenlikea
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功