注册 登录
编程论坛 VB6论坛

动态背景 上加按钮

罗丹丹 发布于 2013-05-01 00:43, 1721 次点击
我用VB做了一个动态背景的登录界面,但是插入的动态背景上不能添加按钮,查了资料了没有说这个的。。百度也没有。。哎。。有木有大侠知道啊,望指教。。
还有 正要吧自己做的窗口变成[local]1[/local]  而不是[local]2[/local],,我觉得那种的更加美观。。
15 回复
#2
Artless2013-05-01 12:47
没图
#3
罗丹丹2013-05-02 01:02
那第一个问题呢,插入了一张动态背景 但是在背景上不能添加按钮。。。求帮忙。。 QQ425262330
#4
风吹过b2013-05-02 08:15
这个动态背景是怎么贴上去的。这个是关键。
#5
yz10252013-05-02 14:18
是像Win7桌布动态变换的布景效果吗?
#6
yz10252013-05-02 14:33
每3秒换一次背景~还是能加按钮阿?
只有本站会员才能查看附件,请 登录
#7
yz10252013-05-02 14:36
GIF也是可以~但比较费工~背景归背景~
真不行贴个透明的Frame上去就好了阿~
#8
罗丹丹2013-05-02 21:40
我弄得不是那种播放幻灯片那样的,是直接的一张动态图片,GIF格式的,
只有本站会员才能查看附件,请 登录
#9
wube2013-05-03 02:31
'专案/设定引用项目/ ActiveMovie的控制型Libray在图片框控件中显示GIF
'动画(图片),凡有句柄HWND的窗体控件均可以
'在窗体Form1上上添加2个命令按钮command1的命令2和1个图片框控件图片
'调用运动图片类型库Quartz.dll中,在C:\ WINDOWS\ SYSTEM32目录下

之前试过放GIF动画OK~这网路上都查得到~
你要的东西理论上不难~不过还是得上机试试~
甚至你要用Flash动画也行~
#10
罗丹丹2013-05-03 14:20
楼上的,你那个我看不懂~~~~(>_<)~~~~ 我是新手。。。
#11
yz10252013-05-03 18:30
http://www.
试试吧~不过我不是像他用控件做的~
我是用动态加载类型~又是另一种方法~
方式很多~这就是编程好玩的地方~
#12
wube2013-05-03 23:02
只有本站会员才能查看附件,请 登录
#13
wube2013-05-03 23:04
不介意效能的话~VB几乎是万能的~
#14
luorl2013-05-08 21:03
只有本站会员才能查看附件,请 登录

是不是像这样?
#15
yz10252013-05-10 12:40
程序代码:

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
#16
louoo2013-05-10 15:02
学习
1