在图片框写文字和图片 我在"Text1"控件里写入了文字"你好",在"Picture1"里导入了一张图片,怎样实现单击Command1控件使得"Text1"的"你好"和"Picture1"的图片合并在一起(文字在前,后面显示图片),并且显示在"Picture2"呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private Sub Command1_Click() Picture1.AutoRedraw = True Picture1.Print Text1.Text Picture2.PaintPicture Picture1.Image, 0, 0End Sub '添加 Picture1 Picture2 Text1'Picture1请先装载一张图片Option ExplicitPrivate Declare Function GdiTransparentBlt Lib "gdi32" (ByVal hdc1 As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal W1 As Long, ByVal H1 As Long, ByVal Hdc2 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal W2 As Long, ByVal H2 As Long, ByVal Color As Long) As LongPrivate Declare Function GetDesktopWindow Lib "user32" () As LongPrivate Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongDim transcolor&Private Sub Form_Load() With Picture1 .ScaleMode = 3 .AutoRedraw = True .BorderStyle = 0 .AutoSize = True .Move 0, 0 End With With Picture2 .BorderStyle = 0 .AutoRedraw = True .Move Screen.Width End With Set Picture2.Container = Picture1 Text1.Width = 3900: Text1.Height = 495 Text1.FontSize = 24: Text1.ForeColor = QBColor(11) Text1.FontBold = True: Text1.FontItalic = True Text1.Text = "CBM666的TextBox" Text1.Move (Picture1.Width - Text1.Width) \ 2, 100 Set Text1.Container = Picture1 '*************** 窗体置中 *************** Me.BorderStyle = 0: Me.Caption = "": Me.Width = Picture1.Width: Me.Height = Picture1.Height Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2 transcolor = vbWhiteEnd SubPrivate Sub Form_Activate() Call GetbackpicEnd SubSub Getbackpic() Dim lDesktop As Long Dim lDC As Long Me.AutoRedraw = True Text1.BorderStyle = 0 Picture2.Width = Text1.Width: Picture2.Height = Text1.Height lDesktop = GetDesktopWindow() '取得桌面窗口 lDC = GetDC(lDesktop) '取得桌面窗口的设备场景 Me.Refresh BitBlt Picture2.hDC, 0, 0, Text1.Width, Text1.Height, lDC, (Me.Left + Picture1.Left) \ 15 + Text1.Left, (Me.Top + Picture1.Top) \ 15 + Text1.Top, vbSrcCopy '将桌面图象绘制到窗体 Text1.Move Screen.Width GdiTransparentBlt Picture1.hDC, (Picture1.Width \ 15 - Picture2.Width) \ 2, 10, Picture2.Width, Picture2.Height, Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, transcolor Picture2.Move Screen.WidthEnd SubPrivate Sub Picture1_Click() Unload MeEnd Sub'效果图:http://p.blog.csdn.net/images/p_blog_csdn_net/cbm666/366646/o_QQText.jpg VB组合的问题 各位大侠! 小鸟刚刚上路 遭遇某些阻力 请大家帮帮忙 小弟感激不禁 硬盘序列号(在线等) 紧急求助!!!求时间 哈哈。一个特意搞怪的问题,欢迎挑战 ^_^ 请问以下16进制的ASCII码是什么? 怎么让一个TEXT里有不同颜色的字 困扰了我好久一个问题,请帮忙 各位大虾见多识广,能否为本菜鸟介绍几本关于API的快速查考,或示例类的书\文章. VB怎样判断一个程序是否存在 如何让VB做成的软件会自动检测更新版本出来了。 VB 能不能取到当前页面上某个位置是什么控件,该控件上面是什么内容?
Picture1.AutoRedraw = True
Picture1.Print Text1.Text
Picture2.PaintPicture Picture1.Image, 0, 0
End Sub
Private Declare Function GdiTransparentBlt Lib "gdi32" (ByVal hdc1 As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal W1 As Long, ByVal H1 As Long, ByVal Hdc2 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal W2 As Long, ByVal H2 As Long, ByVal Color As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Dim transcolor&Private Sub Form_Load()
With Picture1
.ScaleMode = 3
.AutoRedraw = True
.BorderStyle = 0
.AutoSize = True
.Move 0, 0
End With
With Picture2
.BorderStyle = 0
.AutoRedraw = True
.Move Screen.Width
End With
Set Picture2.Container = Picture1
Text1.Width = 3900: Text1.Height = 495
Text1.FontSize = 24: Text1.ForeColor = QBColor(11)
Text1.FontBold = True: Text1.FontItalic = True
Text1.Text = "CBM666的TextBox"
Text1.Move (Picture1.Width - Text1.Width) \ 2, 100
Set Text1.Container = Picture1
'*************** 窗体置中 ***************
Me.BorderStyle = 0: Me.Caption = "": Me.Width = Picture1.Width: Me.Height = Picture1.Height
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
transcolor = vbWhite
End SubPrivate Sub Form_Activate()
Call Getbackpic
End SubSub Getbackpic()
Dim lDesktop As Long
Dim lDC As Long
Me.AutoRedraw = True
Text1.BorderStyle = 0
Picture2.Width = Text1.Width: Picture2.Height = Text1.Height
lDesktop = GetDesktopWindow() '取得桌面窗口
lDC = GetDC(lDesktop) '取得桌面窗口的设备场景
Me.Refresh
BitBlt Picture2.hDC, 0, 0, Text1.Width, Text1.Height, lDC, (Me.Left + Picture1.Left) \ 15 + Text1.Left, (Me.Top + Picture1.Top) \ 15 + Text1.Top, vbSrcCopy '将桌面图象绘制到窗体
Text1.Move Screen.Width
GdiTransparentBlt Picture1.hDC, (Picture1.Width \ 15 - Picture2.Width) \ 2, 10, Picture2.Width, Picture2.Height, Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, transcolor
Picture2.Move Screen.Width
End SubPrivate Sub Picture1_Click()
Unload Me
End Sub'效果图:
http://p.blog.csdn.net/images/p_blog_csdn_net/cbm666/366646/o_QQText.jpg