程序员vb??

来源:百度知道 编辑:UC知道 时间:2024/06/07 04:42:54
Private Sub Form Click()
Dim i , j , c As Integer , StrTemp As String
Dim a(9) As Integer
a(0) = 0 : a(1) = 1 : StrTemp = Str(a(1)) + Space(3)
CurrentX = (ScaleWidth一TextWidth(StrTemp))/2
Print StrTemp
For j = 2 To 9
a(j)= 1
For c = j-1 To 2 Step - 1
a(c) = a(c)+a(c-1)
Next
strtemp = “”
For c = 1 To j
StrTemp = StrTemp & Str( a(c) )& Space (5 - Len (Str (a (c))))
Next
CurrentX = (ScaleWidth一TextWidth(StrTemp))/ 2
Print StrTemp
Next
End Sub
详细说以下 是什么意思
问题一CurrentX = (ScaleWidth一TextWidth(StrTemp))/2
问题二 StrTemp = StrTemp & Str( a(c) )& Space (5 - Len (Str (a (c))))

CurrentX 是将输入点的横坐标定点位置,
比如 CurrentX =1 就是将输入点横坐标定点在1.
StrTemp & Str( a(c) )& Space (5 - Len (Str (a (c))))是一个字符连接运算,Str将一个变量强行字符化,len我就不说了吧,你自己多查查Visual Basic 函数速查