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
=
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
有一个方法就是在picture上打印,代码如下:Private Sub Command1_Click()With Picture1
.Cls
.CurrentX = 100
.CurrentY = 100
End With
Picture1.Print "OK"
End Sub但缺点挺多的,比如窗体的刷新就很麻烦。 还有就是用一个label控件,把label放到picture里,把backstyle属性改成0就可以让label透明了!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)