unfpa:请VB高手告诉我在窗体的(1500,500)处显示一条语句怎么编程?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/06 00:04:52

outtextxy(15000, 500, "语句");

VB6.0中使用自定义函数功能,可实现在vb的窗体上指定位置写文字,且字号大小可按要求改变,代码如下:
Option Explicit
Dim xx, yy As Integer
Dim fnt As Long
Dim txt As String
Dim wp As Variant

Public Function xp( xx As Variant, yy As Variant, fnt As Variant, txt As Variant)
Form1.CurrentX = xx
Form1.CurrentY = yy
Form1.FontSize = fnt
Form1.Print txt '
End Function

Private Sub Form_Load()
Form1.AutoRedraw = True
xx = 1500
yy = 500
fnt = 24
txt = "这是VB对窗体上写字的演示"
wp = xp(xx, yy, fnt, txt)
End Sub
另请参考如下网址:
http://iask.sina.com.cn/b/3049914.html