| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1721 人关注过本帖, 2 人收藏
标题:动态背景 上加按钮
只看楼主 加入收藏
yz1025
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:6
帖 子:491
专家分:919
注 册:2012-10-26
收藏
得分:0 
http://www.
试试吧~不过我不是像他用控件做的~
我是用动态加载类型~又是另一种方法~
方式很多~这就是编程好玩的地方~

不要投我
2013-05-03 18:30
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
收藏
得分:0 
3.rar (376.49 KB)

不要選我當版主
2013-05-03 23:02
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
收藏
得分:0 
不介意效能的话~VB几乎是万能的~

不要選我當版主
2013-05-03 23:04
luorl
Rank: 2
等 级:论坛游民
威 望:1
帖 子:8
专家分:16
注 册:2006-7-15
收藏
得分:0 
循环换图片.rar (1.04 MB)

是不是像这样?
2013-05-08 21:03
yz1025
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:6
帖 子:491
专家分:919
注 册:2012-10-26
收藏
得分:0 
程序代码:
Option Explicit

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Const RGN_AND = 1
Const RGN_COPY = 5
Const RGN_DIFF = 4
Const RGN_OR = 2
Const RGN_XOR = 3

Private Type POINTAPI
    x As Long
    Y As Long
End Type

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Public Sub MakeTransparent(frm As Variant)
Dim rctClient As RECT, rctFrame As RECT
Dim hClient As Long, hFrame As Long
    
    '获得窗口矩形区域
    GetWindowRect frm.hWnd, rctFrame
    GetClientRect frm.hWnd, rctClient
    
    '将窗口矩形坐标转换为屏幕坐标
    Dim lpTL As POINTAPI, lpBR As POINTAPI
    
    lpTL.x = rctFrame.Left
    lpTL.Y = rctFrame.Top
    
    lpBR.x = rctFrame.Right
    lpBR.Y = rctFrame.Bottom
    
    ScreenToClient frm.hWnd, lpTL
    ScreenToClient frm.hWnd, lpBR
    
    rctFrame.Left = lpTL.x
    rctFrame.Top = lpTL.Y
    rctFrame.Right = lpBR.x
    rctFrame.Bottom = lpBR.Y
    
    rctClient.Left = Abs(rctFrame.Left)
    rctClient.Top = Abs(rctFrame.Top)
    rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
    rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
    
    rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
    rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
    rctFrame.Top = 0
    rctFrame.Left = 0
    
    hClient = CreateRectRgn(rctClient.Left, rctClient.Top, rctClient.Right, rctClient.Bottom)
    hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, rctFrame.Right, rctFrame.Bottom)
    
    CombineRgn hFrame, hClient, hFrame, RGN_XOR
    
    SetWindowRgn frm.hWnd, hFrame, True
    
End Sub

Private Sub Form_Click()
    MakeTransparent Me.Frame1
    MakeTransparent Me.TabStrip1
    MakeTransparent Me.Toolbar1
    MakeTransparent Me.Text1
    Text1.ForeColor = RGB(255, 0, 0)
End Sub

不要投我
2013-05-10 12:40
louoo
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-5-10
收藏
得分:0 
学习
2013-05-10 15:02
快速回复:动态背景 上加按钮
数据加载中...
 
   



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

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