湘西北人才市场怎么样:关于VB的一个问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/27 20:58:52
大家看下面的代码中,

Private Sub Command1_Click()
Dim b As String, textw As Integer, texth As Integer
FontName = "宋体"
FontSize = "30"
ForeColor = QBColor(15)
BackColor = QBColor(8)
a = "你好"
textw = TextWidth(a) / 2
texth = TextHeight(a) - Command1.Height / 2
CurrentX = ScaleWidth / 2 - textw
CurrentY = ScaleHeight / 2 - texth
Print a
End Sub

我不明白的是:
textw = TextWidth(a) / 2
texth = TextHeight(a) - Command1.Height / 2
CurrentX = ScaleWidth / 2 - textw
CurrentY = ScaleHeight / 2 - texth
这段代码的"/2"是什么意思,本人在自学VB.请高手给解释一下.

除以2的意思.

除以2的意思

是除以二的意思,为了得到字符串的中点坐标.