怎样使窗体透明啊?

zhuhao 2003-08-29 08:44:18
我是想在桌面上搞个滚动标题。
...全文
63 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
yunfeng007 2003-09-13
  • 打赏
  • 举报
回复
SetLayeredWindowAttributes是一个win2000以上才加入的api函数,api浏览器找不到没什么奇怪的
goodname008 2003-09-13
  • 打赏
  • 举报
回复
to 楼主:

http://www.mentalis.org/agnet/apiguide.shtml
下载API Guide,里面关于API的资料比较多,有SetLayeredWindowAttributes函数.

或者到
http://down.sk163.com/soft/2062.htm
下载msdn2003
ues 2003-09-13
  • 打赏
  • 举报
回复
能不能实现就窗体透明而控件不透明?
chenkangli 2003-09-12
  • 打赏
  • 举报
回复
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
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 128
SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA ' 128是透明度(0-255)
End Sub
ues 2003-09-11
  • 打赏
  • 举报
回复
zhuhao 2003-09-11
  • 打赏
  • 举报
回复
SetLayeredWindowAttributes这个函数我在API浏览器里没找到啊?
zhuhao 2003-09-09
  • 打赏
  • 举报
回复
SetLayeredWindowAttributes这个函数我在API浏览器里没找到啊?
zhuhao 2003-09-02
  • 打赏
  • 举报
回复
我在书店找到这方面的书。请大家介绍一下。谢谢啦!
goodname008 2003-08-30
  • 打赏
  • 举报
回复
同意 pigpag(噼里啪啦) 的看法,我觉得高中水平加点计算机知识应该可以看懂MSDN了。
(不好意思,打错了一字)
goodname008 2003-08-30
  • 打赏
  • 举报
回复
同意 pigpag(噼里啪啦) 的看法,我觉得高中水平加点计算机知道应该可以看懂MSDN了。
pigpag 2003-08-30
  • 打赏
  • 举报
回复
用了多了就知道了

首先基础的语法和词汇要过关。
goodname008 2003-08-30
  • 打赏
  • 举报
回复
应该有,可能是计算机专业英语之类的书,去书店看看吧。
我还没系统学过计算机专业英语呢,不过据说大三要开这门课。
zhuhao 2003-08-30
  • 打赏
  • 举报
回复
请问有没有关于电脑英语的书啊
goodname008 2003-08-29
  • 打赏
  • 举报
回复
to aifox(hunono):
http://www.mentalis.org/agnet/apiguide.shtml
下载一个API-Guide,不过E文要过关,其实也不是很难。
aifox 2003-08-29
  • 打赏
  • 举报
回复
好象用vb编一些稍微高级一点的程序就需要api
请问该如何学习api呢
战箫 2003-08-29
  • 打赏
  • 举报
回复
用API函数,楼上说的很祥细了。
goodname008 2003-08-29
  • 打赏
  • 举报
回复
' 把下面的代码直接放到窗体代码中就OK了.

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
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 128
SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA ' 128是透明度(0-255)
End Sub

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧