vb如何将图片框中的文字居中
展开全部
是水平居中还是垂直居中?还是两者都要居中?
水平居中:
Dim s As String
s = "要显示的文字"
With Picture1
.CurrentX = (.ScaleWidth - .TextWidth(s)) \ 2
End With
Picture1.Print s
垂直居中:
Dim s As String
s = "要显示的文字"
With Picture1
.CurrentY = (.ScaleHeight - .TextHeight(s)) \ 2
End With
Picture1.Print s
完全居中:
Dim s As String
s = "要显示的文字"
With Picture1
.CurrentX = (.ScaleWidth - .TextWidth(s)) \ 2
.CurrentY = (.ScaleHeight - .TextHeight(s)) \ 2
End With
Picture1.Print s
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询