怎样用vb在窗体上输出九九乘法表?

来源:百度知道 编辑:UC知道 时间:2024/06/28 10:09:01

Private Sub Form_Click()
Dim i, j As Integer
Dim s As String
Print Tab(35); "九九乘法表"
For i = 1 To 9
For j = 1 To i
s = i & "×" & j & "=" & i * j
Print Tab((j - 1) * 9 + 2); s;
Next j
Print
Next i
End Sub

sub multipliy()
dim arr1(1 to 10,1 to 10) as byte
dim row as byte,column as byte
print tab(2);
for row=1 to 9
for column=1 to 9
arr1(row,column)=row*column
next column
print row;" ";
next row
print " "
for row=1 to 9
print row;" ";
for column=1 to 9
print arr1(row,column);" ";
next column
print ""
next row
end sub

Private Sub Form_Load()
Dim Cols, Rows, strMsg
strMsg = ""
For Rows = 1 To 9
For Cols = 1 To Rows
strMsg = strMsg & Cols & "X" & Rows & "=" & Rows