Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim A, B, C, I, J As Integer
Dim S1 As String
S1 = Space(4)
A = Val(TextBox2.Text)
B = Val(TextBox3.Text)
If A >= 19 Then
A = 19
TextBox2.Text = A.ToString
End If
If B >= 19 Then
B = 19
TextBox3.Text = B.ToString
End If
TextBox1.Clear()
For I = 1 To A Step 1
For J = 1 To B Step 1
C = I * J
TextBox1.Text = TextBox1.Text + S1
TextBox1.Text = TextBox1.Text + C.ToString
If J = B Then
TextBox1.Text = TextBox1.Text & vbNewLine & vbNewLine
End If
Next J
Next I
End Sub
End Class
沒有留言:
張貼留言