设为首页收藏本站

SKY外语、计算机论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1874|回复: 0
打印 上一主题 下一主题

Shape1和一个Picture1透明

[复制链接]

60

主题

8

好友

1161

积分

金牌会员

Rank: 6Rank: 6

生肖
星座
处女座
性别

最佳新人 活跃会员 灌水之王 论坛元老

跳转到指定楼层
楼主
发表于 2012-5-14 20:03:57 |只看该作者 |倒序浏览
本帖最后由 sky_yx 于 2015-12-30 14:22 编辑

  1. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  3. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  4. Const WS_EX_LAYERED = &H80000
  5. Const GWL_EXSTYLE = (-20)
  6. Const LWA_COLORKEY = &H1
  7. Dim rtn&
  8. Private Sub Form_Load()
  9. Picture1.BackColor = RGB(66, 66, 66)
  10. Shape1.BackColor = RGB(66, 66, 66)
  11. rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
  12. rtn = rtn Or WS_EX_LAYERED
  13. SetWindowLong hwnd, GWL_EXSTYLE, rtn
  14. SetLayeredWindowAttributes hwnd, RGB(66, 66, 66), &H2, LWA_COLORKEY
  15. End Sub
复制代码


分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
分享淘帖0 收藏收藏0 评分评分
你老婆要生了。我要当爹了
您需要登录后才可以回帖 登录 | 立即注册


手机版|SKY外语计算机学习 ( 粤ICP备12031577 )    

GMT+8, 2024-4-23 17:32 , Processed in 0.122316 second(s), 29 queries .

回顶部