我的控制两行文字打印在picture的左上顶头部份的居中位置失败了
示意图:
xxxxxxxxxx |
yyyy |
|
---------------------------------------
|
|
|
代码如下(Pic为picture控件):
Dim LTxt As Long
LTxt = TextWidth("2007年5月5日")
With Pic
.Cls
.CurrentX = (Pic.Width \ 2 - LTxt) \ 2
.CurrentY = 10
Pic.Print , cTitle
LTxt = TextWidth("分布图")
.CurrentX = (Pic.Width \ 2 - LTxt) \ 2
.CurrentY = 15 + TextHeight("分布图")
Pic.Print , "分布图"
End With
可是出现的是这种情况:
xxxxxxxxxx |
yyyy |
|
---------------------------------------
|
|
|
显然第一行文字在左上顶头部份靠右了,没有居中;第二行文字却与第一行文字起始点一样了,应该向右缩进几个空格,因为第二行文字要短一些。真郁闷,那点出错了,请大虾们指点一下。