4个回答
展开全部
简单的实现方法:在PictureBox中加入一个Label控件,利用这个Label显示文字。将Label背景设置为透明,所显示的文字不会影响画面。
具体实现方法如下:
(1)在窗体Form1上布置一个PictureBox,将一个Label拖入到PictureBox内。再在窗体上布置一个TextBox
在PictureBox中载入一个图片;将label1的BackStyle属性设置为: 0 -Transparent
(2)窗体代码
Option Explicit
Private Sub Form_Load()
Label1.Caption = ""
Text1.Text = ""
End Sub
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
(3)运行效果
展开全部
VB6.0中使用函数功能,可实现在vb的picture图中写文字,且字号及字体颜色可按要求改变,代码如下:
Option Explicit
Dim xx, yy As Integer
Dim fnt As Long
Dim txt As String
Dim colvb As String
Dim wp As Variant
Public Function xp(colvb As Variant, xx As Variant, yy As Variant, fnt As Variant, txt As Variant)
Picture1.ForeColor = colvb 'QBColor(14)
Picture1.CurrentX = xx
Picture1.CurrentY = yy
Picture1.FontSize = fnt
Picture1.Print txt '
End Function
Private Sub Form_Load()
Picture1.AutoRedraw = True
xx = 500
yy = 500
fnt = 24
colvb = vbRed
txt = "这是VB对PICTURE图片框的图片上写字的演示"
wp = xp(colvb, xx, yy, fnt, txt)
xx = 500
yy = 2500
fnt = 48
colvb = vbGreen
txt = "字号调大的演示"
wp = xp(colvb, xx, yy, fnt, txt)
End Sub
http://iask.sina.com.cn/b/3049914.html
下有演示工程文件:
picturePrint.rar
Option Explicit
Dim xx, yy As Integer
Dim fnt As Long
Dim txt As String
Dim colvb As String
Dim wp As Variant
Public Function xp(colvb As Variant, xx As Variant, yy As Variant, fnt As Variant, txt As Variant)
Picture1.ForeColor = colvb 'QBColor(14)
Picture1.CurrentX = xx
Picture1.CurrentY = yy
Picture1.FontSize = fnt
Picture1.Print txt '
End Function
Private Sub Form_Load()
Picture1.AutoRedraw = True
xx = 500
yy = 500
fnt = 24
colvb = vbRed
txt = "这是VB对PICTURE图片框的图片上写字的演示"
wp = xp(colvb, xx, yy, fnt, txt)
xx = 500
yy = 2500
fnt = 48
colvb = vbGreen
txt = "字号调大的演示"
wp = xp(colvb, xx, yy, fnt, txt)
End Sub
http://iask.sina.com.cn/b/3049914.html
下有演示工程文件:
picturePrint.rar
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Picture1.Print:Picture1.Print "VB中怎样在picturebox 中输入文字"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
麻烦,直接放进去一个label就行了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |